[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
python [2017/10/13 12:06]
bojar [Virtual environments] caveat about shebangs
python [2017/10/17 09:19]
belohlavek [Virtual environments]
Line 15: Line 15:
     python3 -m venv my-project-name     python3 -m venv my-project-name
 where ''my-project-name'' can be a relative or absolute path to a directory which will be created. where ''my-project-name'' can be a relative or absolute path to a directory which will be created.
-**Caveat:** the path to the directory should be rather short, there is a limit on shebang paths so you can get strange errors like ''ipython3: bad interpreter: No such file or directory'' if your ipython3 installed in the venv starts with ''#!/...a..very..long..path...''+**Caveat:** the path to the directory should be rather short, there is a limit on shebang paths so you can get strange errors like ''ipython3: bad interpreter: No such file or directory'' if your ipython3 is installed in the venv starts with ''#!/..a..very..long..path..''
  
 You can use any Python version for the new environment, e.g. ''/opt/python/3.5.4/bin/python3 -m venv my-project-name-python3.5'' You can use any Python version for the new environment, e.g. ''/opt/python/3.5.4/bin/python3 -m venv my-project-name-python3.5''
Line 34: Line 34:
    virtualenv my-project-name    virtualenv my-project-name
    source my-project-name/bin/activate    source my-project-name/bin/activate
 +   
 +==== IPython in virtual envs. ====
 +When using virtuaenvs, ipython is (in some versions) confused uses incorrect python interpreter. The following alias fixes this issue:
 +<code>
 +alias ipython="python -c 'import IPython; IPython.terminal.ipapp.launch_new_instance()'"
 +</code>
  
 ===== Installing directly from Git ===== ===== Installing directly from Git =====

[ Back to the navigation ] [ Back to the content ]