{"id":1182,"date":"2018-02-14T14:34:17","date_gmt":"2018-02-14T20:34:17","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=1182"},"modified":"2018-02-14T14:34:17","modified_gmt":"2018-02-14T20:34:17","slug":"python3-and-pip","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/python3-and-pip\/","title":{"rendered":"Python3 and pip"},"content":{"rendered":"

I am converting some scripts to python3 and noticed the pip modules in use for python2 need to be added for python3. I am not using virtualenv so below is my fix on Ubuntu 17.10.<\/p>\n

Missing module oci.<\/p>\n

\r\n$ python3 OCI_Details.py -t ocid1.tenancy.oc1..aa...mn55ca\r\nTraceback (most recent call last):\r\n  File "OCI_Details.py", line 14, in <module>\r\n    import oci,optparse,os\r\nModuleNotFoundError: No module named 'oci'\r\n<\/pre>\n

Python2 module is there.<\/p>\n

\r\n$ pip list --format=columns | grep oci\r\noci             1.3.14 \r\n<\/pre>\n

Ubuntu has python3-pip<\/p>\n

\r\n$ sudo apt install python3-pip\r\n$ pip3 install oci\r\n$ pip3 list --format=columns | grep oci\r\noci                   1.3.14   \r\n<\/pre>\n

Check my converted script.<\/p>\n

\r\n$ python3 OCI_Details.py -t ocid1.tenancy.oc1..aaaaaa...5ca\r\nOCI Details: 0.9.7\r\n..\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

I am converting some scripts to python3 and noticed the pip modules in use for python2 need to be added<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[87,13],"tags":[],"class_list":["post-1182","post","type-post","status-publish","format-standard","hentry","category-oci","category-python"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=1182"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1182\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=1182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=1182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=1182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}