Services Blog Français

Enable global site packages in an existing virtualenv

| by jpic | python virtualenv

Nowadays, virtualenv uses --no-site-packages by default. This means that the created virtualenv will not access global site-packages modules ie. /usr/lib/python2.7/site-packages/.

To enable global site-packages again, just remove this file::

your_env/lib/python2.7/no-global-site-packages.txt

Why would you do that ?

Some modules are complicated to install (xpyb) or take too much time to compile (pyqt). Using the distro packages can be pretty useful !

Jedi-vim/rope takes too long

| by jpic | python vim

For those using jedi-vim are indirectly using rope refactoring library.

If you are also using a home-level virtualenv ie. in ~/env/ then your vim instance might take crazy long time.

First things first, rope creates a .ropeproject directory where it thinks the project root is. And it will scan every file in every sub directory. A quick and dirty solution is to create empty .ropeproject folders lower in the $HOME filesystem. Rope will automatically use this folder if it finds no other .ropeproject folder at a lower level.

Read More
Previous Page 26 of 33 Next Page

They trust us

Contact

logo