Working with second python version in pycharm

10.3k views Asked by At

I need to work with python version 3.5 in order to run and modify a script containing pyqt5. I am currenly running python 3.6.

I would like to know how I download python 3.5 and install pyqt5 for that environment and then make it available for pycharm community edition. I have tried to use anaconda to manage a second python version but it is not working. Keeps giving me pyqt5 not found. Thank you

3

There are 3 answers

3
Amit On BEST ANSWER

You can create a new virtual environment with conda using the following command and specify the required version. More info on conda create

conda create -n py35 python=3.5

it will install the Python3.5 on your system most likely in C:\Users\user\AppData\Local\Continuum\Anaconda3\envs You can then add that python version in Pycharm as the project interpreter using

File -> Settings --> Project --> Project Interpreter

Click on the Setttings icon in the right pane & locate the Python version on your system and then add it as the python version for this project.

Refer Pycharm documentation for more details

0
BlooB On

I would use virtualenv and configre pycharm to use it. It is more demanding but fully independent.

look here on how to setup virtualenv and the packages that you need

Than do this in pycharm so it can use the enviorment that you create.

Select File, click Settings.
In the left pane, enter Project Interpreter in the search box, then click Project Interpreter.
In the right pane, click the gear icon, click Moreā€¦.
In the Project Interpreters dialog box, click the plus sign +, click Add Local.
Enter ~/virtualenvs/<your virtualenv name>/bin/python in the path. If you followed the earlier post to setup a virtual environment for Python then enter ~/virtualenvs/api/bin/python.
Click OK.
Select 2.7.6 virtualenv at ~/virtualenvs/api, click the edit icon.
Check Associate this virtual environment with current project.
Click OK.
Click OK.
Click Apply, click OK
0
aspo On

To use a different version of Python in Pycharm, install the specific version for python and install it normally. You can find the version from the Python website. After installing, open Pycharm project, then go to File>Settings>Project: Project Interpreter. Under the project interpreter select the python version that you want to associate with the project. Click apply and that's it.

See the attached image for guidance.enter image description here