User Tools

Site Tools


set_up_your_own_python_environment

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
set_up_your_own_python_environment [2020/11/03 05:19] – fix format peteyboyset_up_your_own_python_environment [2020/11/03 05:31] (current) – fix with example peteyboy
Line 1: Line 1:
 ====Set Up Your Local Python Environment==== ====Set Up Your Local Python Environment====
  
-Use the below to install python libraries that "normally" would be installed in a system directory such as ''/usr/local/lib/pythonX.Y'' Use the ''--user'' flag to install to a directory you have control over as a user. Here are more details:+Use the below to install python libraries that "normally" would be installed in a system directory such as ''/usr/local/lib/pythonX.Y'' Use the ''<nowiki>--</nowiki>user'' flag with the ''pip'' tool to install to a directory you have control over as a user. Here are more details:
  
-  * ''--user'' installs in the directory specified in ''site.USER_SITE''+  * ''<nowiki>--</nowiki>user'' installs in the directory specified in ''site.USER_SITE''
     * example: ''~/.local/lib/pythonX.Y/site-packages''     * example: ''~/.local/lib/pythonX.Y/site-packages''
-  * add this folder to your PATH (in ~/.bash_profile file):+  * add this folder to your PATH (in ''~/.bash_profile'' file):
     * ''export PATH=$PATH:~/.local/lib/pythonX.Y/site-packages''     * ''export PATH=$PATH:~/.local/lib/pythonX.Y/site-packages''
 +
 +Here is an example:
 +
 +//pip install <nowiki>--</nowiki>user mypackage//
  
  
Line 14: Line 18:
 Sources: Sources:
   * https://stackoverflow.com/questions/42988977/what-is-the-purpose-of-pip-install-user   * https://stackoverflow.com/questions/42988977/what-is-the-purpose-of-pip-install-user
-  * https://realpython.com/python-virtual-environments-a-primer/+  * https://packaging.python.org/tutorials/installing-packages/#optionally-create-a-virtual-environment
set_up_your_own_python_environment.1604380771.txt.gz · Last modified: 2020/11/03 05:19 by peteyboy