Pyvenv & pip is not installed in local site packages

I am testing Django 1.6b, Python 3.3.2 (compiled from source) and pyvenv with Ubuntu 12.04.

Each time I try to install and install pip install [package] , the package tries to install itself globally, and not in the local environment. A simple workflow is as follows:

$ pyvenv environments/roebk

$ source environments/roebk/bin/activate

$ (roebk) pip install south

error: could not create '/usr/local/lib/python3.3/site-packages/south': Permission denied

I double checked that I am using the correct version of pip.

$ pip -V pip 1.4 from /usr/local/lib/python3.3/site-packages/pip-1.4-py3.3.egg (python 3.3)

Did I miss something obvious?

+4
source share
2 answers

Have you installed setuptools and pip in your environment? virtualenv automatically installs setuptools and pip in a new environment.

  $ virtualenv qwerty 
 New python executable in qwerty / bin / python
 Installing setuptools ............ done. 
 Installing pip ............... done.
 $ 

According to pyvenv docs you need to install them in a new environment manually.

General installation tools such as Distribute and pip work as expected with venvs - that is, when venv is active, they install Python packages in Vienna, without requiring him to be told to do this explicitly. Of course, you need to install them into a vein first : this can be done by running distribute_setup.py with venv turned on, then by running easy_install pip. Alternatively, you can download the source files and run python setup.py after unpacking, with the veins activated.

+7
source

After the official docs, I thought Python 3.4 would install pip automatically, but it didn't seem to be: Changed in version 3.4: default installation, options --without-pip and --copies added

EDIT: somehow I managed to use the version of Python3.3.2 also installed on this machine. With Python3.4, it works as expected.

+1
source

Source: https://habr.com/ru/post/1494593/


All Articles