Lewis Parker
Lewis Parker

Reputation: 3

Python version 2.7 despite conda 3.6 environment

I am using Ubuntu 16 and conda 4.9.2. I created an environment with

$ conda create --name py36 python=3.6.2

The above python version is available at

$ conda search python

But the following gives wrong output.

$ conda activate py36
(py36) $ python --version
Python 2.7.12

I tried to implement the solution here

But there is no folder named 'bin' at

/anaconda3/envs/py36

I then tried the solution here which suggests

$ pip uninstall virtualenvwrapper

The error is:

ImportError: No module named typing

Then I tried to install typing

$ pip install typing

I get the same import error.

How to solve this and create environment with specified version?

Upvotes: 0

Views: 255

Answers (1)

Jerzy Jamroz
Jerzy Jamroz

Reputation: 106

Re-login and try:

conda update conda
conda create -n py36 python=3.6.2 anaconda
conda activate py36

Also, check if conda updated your user .bashrc file with:

# >>> conda initialize >>>
# Conda generated block of code
# <<< conda initialize <<<

If you want the conda python, then try not to use any other python virtual solutions (uninstall them) - leave just the system defaults.

Upvotes: 1

Related Questions