![]() ![]() If you need the latest version, or the module is not in the Ubuntu repository then start a virtualenv and use pip to install the package. For personal Python projects use pip and wheel in a virtualenv However, I second Wojciech's suggestion to use virtualenv. Ubuntu repository has both pip, virtualenv and setuptools. If you are 100% confident that the package will not interfere with your Ubuntu system in any way, then you can install it using pip and Ubuntu is nice enough to keep these packages separate from the distro packages by placing the distro packages in a folder called dist-packages/. And every 6 months, a new cycle of packages will be released with the latest distribution of Ubuntu. Most likely every Python package you will need is in the Ubuntu repository, and probably already installed on your machine. You are in luck, because you are using Ubuntu, one of the most widely supported and oft updated distributions existing. $ sudo apt-get install python-numpy python-scipy However, installing numpy & scipy through the Ubuntu repository is as easy as. For example if you try pip install numpy to install numpy & scipy unless you have already installed gfortran, atlas-dev, blas-dev and lapack-dev, you will see an endless stream of compile errors. ![]() Lastly some things are just easier to install using either Ubuntu packages. So you should be nervous about typing $ sudo pip. Python install gfortran code#In general you only want to install trusted code into your OS. Therefore doing something like pip install requests will not realize that chardet is already installed in your system because the Ubuntu version has a different name, and consequently install a new version which will corrupt your system in a minor insignificant way but still why would you do that. Python-chardet is an example of a package which at one time was named one thing on PyPI and another thing in the Ubuntu repository. I think most packages have corresponding Launchpad repos so you can file issues.Īnother reason to use either Ubuntu packages is that sometimes these Python packages have different names depending on where you downloaded them from. In addition all required dependencies are also installed and a log of installs is maintained so they can be rolled back. These packages are tested, usually pre-compiled so they install faster and ultimately designed for Ubuntu. Python install gfortran software#This is the main reason I never use pip on my Ubuntu system, but instead I use either Ubuntu Software Center, synaptic, apt-get, or the newer just apt, which all by default install packages from the Ubuntu repository. Ubuntu uses Python for many important functions, therefore interfering with Python can corrupt your OS. For global Python packages, use either the Ubuntu Software Center, apt, apt-get or synaptic This is somewhat a duplicate of easy_install/pip or apt-get. Updated: : PEP 513 - manylinux binaries for PyPI ![]() Updated: : since conda-4.4.0 use conda to activate anaconda on all platforms Updated: : This post mostly mentions virtualenv, but according to the Python doc about module installation, since Python 3.5 "the use of venv is now recommended for creating virtual environments", while virtualenv is an alternative for versions of Python prior to 3.4. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |