I have decided to have both python 2 and 3 installed on my Windows PC. Python 3 was included with Anaconda, and works flawlessly after the installation of Anaconda.
After having created successfully a python 2 environment:
conda create --name py27 python=2.7
I noticed that no python.py file has been created in C:\Users\Hélain\IT\Anaconda3\envs\py27.
Typing python in my terminal launches my python 3 python and py27 is not considered a command. Activating or deactivating the environment does no change this behavior.
Result of typing python:
C:\Users\Hélain>activate py27
Deactivating environment "C:\Users\Hélain\IT\Anaconda3"...
Activating environment "C:\Users\Hélain\IT\Anaconda3\envs\py27"...
[py27] C:\Users\Hélain>python
Python 3.4.1 |Anaconda 2.1.0 (64-bit)| (default, Sep 24 2014, 18:32:42) [MSC v.1
600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
How do I run python with my environment's version and packages?
Windows. From the Start Menu open the Anaconda Prompt. If you want the location of a Python interpreter for a conda environment other than the root conda environment, run activate environment-name . Run where python .
In "Program/script" textbox you set the path to Python executable (in my case is inside the virtualenv folder). "Add arguments" => Just the name of your Python script (name. ppy). "Start in" => The full path of your Python script (without the name.py).
Click Start�All Programs�Anaconda (64-bit)�Anaconda Command Prompt. � A command prompt window will open. Type idle to run the Python interpreter. A new window titled Python Shell will open and you will see the Python >>> command prompt.
Conda is an open-source package and environment management system that runs on Windows, macOS, and Linux.
In your terminal type:
activate py27
The prompt should change to (py27)
.
Now you can install packages in this environment. For example:
conda install jupyter matplotlib
Launch Python from this terminal with:
python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With