This morning, when I decided to open a new project with a different python version, I thought, “Yeah, I’ll just use a virtualenv”, because the internet said I can “Just do it”. Deactivate your virtualenv by entering deactivate.Use pip to install packages like you usually do.Open Command Prompt or Anaconda Prompt, and activate your virtualenv by entering.Install packagesĬurrently, your virtualenv contains only the crucial packages, pip and setuptools. If you don’t see your python version on the Options list, this might also be the time to update P圜harm… yup, happened to me too… 5. Go to File -> Settings-> Editor -> Inspections -> Python -> Code compatibility Inspection, make sure the box on the top indicates the specific project you are working on, and tick the box of your python version. This will open a prompt window that allows you to define a new interpreter:Īssuming you are using Code Inspections, you might need to tell P圜harm which python version to inspect for. If you are using P圜harm, open the project you would like to work on (that is/will be written with the new python version), and go to File -> Settings -> Project -> Project Interpreter press the gear icon and then Add. Virtualenv C:\Users\\Anaconda3\envs\ -p C:\\Python37\python.exe 4. ĭecide where you want your virtualenv to be, for example, Open the Command Prompt, or if you are using Anaconda open the Anaconda Prompt. Either way, remember this location and let’s denote it from now on with C:\\Python37. Either use the default suggested location for the new python, or supply a location of your choice.You do NOT want to add the new python to your PATH since we are going to have multiple python versions on the same computer, and we would like for each application to know only one python version.Once downloading is finished, open the executable file and an installation prompt will appear. The file you should be downloading is called Windows x86–64 executable installer, or Windows x86 executable installer if for some reason you are using a 32-bit windows. You can download python from the official site, for example for python3.7.3 go here. If you already have some virtual environments, or are using Anaconda, make sure the next steps are performed from outside all these environments. I haven’t tried it myself, please let me know how it went if you are going down that road :) 1. If you are using the Anaconda App this process might be easier using their GUI. (I) Activate virtualenv: open Command Prompt and enter path\to\env\Scripts\activate.bat If you are using P圜harm, update the Project Interpreter and the Code compatibility inspection.Virtualenv \path\to\env -p path\to\new_python.exe To create a virtualenv, open Command Prompt and enter.Download the desired python version (do NOT add to PATH!), and remember the path\to\new_python.exe of the newly installed version.Open Command Prompt and enter pip install virtualenv.You are tired of the internet telling you to “Just Use Virtualenv”.You would like to use multiple Python versions on the same computer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |