|
|
| (35 intermediate revisions by 5 users not shown) |
| Line 1: |
Line 1: |
| == creating a new virtual environment ==
| | #REDIRECT [[Python#Virtual environments]] |
| | |
| <source lang='bash'>
| |
| virtualenv newenv
| |
| </source>
| |
| | |
| == activating a virtual environment ==
| |
| <source lang='bash'>
| |
| source newenv/bin/activate
| |
| </source>
| |
| <code>
| |
| (newenv)hjm@ubuntu:~$
| |
| </code>
| |
| | |
| == deactivating a virtual environment ==
| |
| <source lang='bash'>
| |
| deactivate
| |
| </source>
| |
| === Make IPython work under virtualenv ===
| |
| source testenv/bin/activate
| |
| | |
| <code>
| |
| File "/usr/bin/ipython", line 11
| |
| print "Could not start qtconsole. Please install ipython-qtconsole"
| |
| ^
| |
| </code>
| |
| This can be resolved by adding a soft link with the name <code>ipython</code> to the <code>bin</code> directory in the virtual environment folder.
| |
| <source lang='bash'>
| |
| ln -s /path/to/virtenv/bin/ipython3 /path/to/virtenv/bin/ipython
| |
| </source>
| |