top of page
Search
  • Writer's pictureSunil Prasad

Using Different versions of python

I am a regular user of python2. I didn't upgrade myself to python3 was solely because the companies I worked with was in python2 and I wanted to have continuity with the same at home. Recently I upgraded myself with a MacBook Pro. Although I had worked on windows or linux OS, macOS was different for me. I would say it was challenging initially but I overcame the initial hiccups. I "brewed" installed and got going. I upgraded myself to python3. After my stint at Animal Logic, I decided to take a break from the continuous job movement and work on my projects which I long wished to do. I developed tools which was backlogged in my to-do list with PyQt5. I wrote some of the tools in python2 for Maya, Nuke. Then I went back to a tool which I wrote in PyQt5. Then I faced with the error "no module named PyQt5". I did basic trouble shooting steps, my python3 was working. the module was installed.


I realised that when I checked the path, It was set to python2. These problems are not faced by us when we are working for companies as these are already setup.

these are the trouble shooting steps I took to switch between python2 and python3 which I am sharing here.

  • checked PyQt5 in package in site-packages of python3 dir. - not existing

  • pip3 install PyQt5 - "satisfied" - no go

  • brew install PyQt5 - "satisfied" - no go

  • install pyenv

    • brew install openssl readline sqlite3 xz zlib - This command relies on Homebrew and installs the few dependencies for macOS users.

    • curl https://pyenv.run | bash

    • pyenv install -v 3.7.2

    • ls ~/.pyenv/versions/ - install locations

    • pyenv global 3.7.2 - set version

    • pyenv versions - shows set versions as well as installed versions.

    • alias py2="pyenv global 2.7.8" alias py3="pyenv global 3.7.0" alias pysys="pyenv global system" - set in .zshrc (found in /Users/username/)

    • python3 -m site --user-site - shows patch of python3

    • code /Users/masnun/.local/lib/python3.5/site-packages/homebrew.pth - add the following and save

      • ​/usr/local/lib/python3.5/site-packages

1 view0 comments

Recent Posts

See All

Making of Multiple knob Changer

In my career as a pipeline TD I first started coding with mel, maya python, pyqt, pyside. Although mel/maya scripting does gets on my nerves sometimes, still there is a vast support and communities wh

AutoDesk maya 2019 install on linux mint 19

According to autodesk website, it is supported on RHEL(red hat) and centos. Considering centos as based on RHEL, it doesn't make sense that they didn't release for ubuntu. So my quest began to install

bottom of page