0

I am creating a Django App and stuck at virtualenv installation. I have seen this and tried to follow but it resulted in this everytime I tried something. Why can't it take python 3 for installing but this works virtualenv venv but it installs for python 2. What should I do?

virtualenv -p python3 venv
Running virtualenv with interpreter /home/oroborus/anaconda3/bin/python3
Using base prefix '/home/oroborus/anaconda3'
New python executable in venv/bin/python3
Also creating executable in venv/bin/python
venv/bin/python3: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
ERROR: The executable venv/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/home/oroborus/PycharmProjects/test-app' (should be '/home/oroborus/PycharmProjects/test-app/venv')
ERROR: virtualenv is not compatible with this system or executable

Typing locate libpython3.5

locate libpython3.5
/home/oroborus/anaconda3/envs/tensorflow/lib/libpython3.5m.so
/home/oroborus/anaconda3/envs/tensorflow/lib/libpython3.5m.so.1.0
/home/oroborus/anaconda3/envs/tensorflow/lib/python3.5/config-3.5m/libpython3.5m.a
/home/oroborus/anaconda3/lib/libpython3.5m.so
/home/oroborus/anaconda3/lib/libpython3.5m.so.1.0
/home/oroborus/anaconda3/lib/python3.5/config-3.5m/libpython3.5m.a
/home/oroborus/anaconda3/pkgs/python-3.5.2-0/lib/libpython3.5m.so
/home/oroborus/anaconda3/pkgs/python-3.5.2-0/lib/libpython3.5m.so.1.0
/home/oroborus/anaconda3/pkgs/python-3.5.2-0/lib/python3.5/config-3.5m/libpython3.5m.a
4
  • Which distribution are you using? Commented Oct 24, 2016 at 19:36
  • I am using Ubuntu 15.04 Commented Oct 24, 2016 at 19:36
  • have you installed python3 on your OS? Commented Oct 24, 2016 at 19:39
  • Yup it's there... python --version gives me this output Python 3.5.2 :: Anaconda 4.1.1 (64-bit) Commented Oct 24, 2016 at 19:51

1 Answer 1

2

In debian like distros python3-venv is available.

Install it using apt sudo apt-get install python3 python3-venv.

Then use it like that python3 -m venv yourvenvfoldername.

EDIT:

In this case anaconda is used, which has the replacement conda for both, pip and virtualenv. There is nice command comparison table available in the docs.

Creating a virtualenv with conda can be done like that:

conda create --name $ENVIRONMENT_NAME python

Sign up to request clarification or add additional context in comments.

8 Comments

Running this gave an output python3 -m venv env Error: Command '['/home/oroborus/PycharmProjects/test-app/env/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
might this be related askubuntu.com/questions/488529/… ?
forget about... this should be fixed in 15.04
anaconda has replacements for venv and pip as described here
So instead of using virtualenv I can use conda do you mean to say probably with this card conda create --name $ENVIRONMENT_NAME python
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.