I'm trying making work scipy in my virtualenv but the only way to install it is with apt-get and there is not a way to install it for my virtual env. Doesn't exits a package for pil, so i tried copy the folder
/usr/lib/python2.7/dist-packages/scipy to /home/envs/conbert/lib/python2.7/site-packages but is not working. Is possible make work scipy for a specific environment?
You can install scipy using pip in your virtualenv with
pip install scipy
pip should install all Python dependencies necessary before installing scipy.
Note that you may have to install some extra non-Python dependencies using apt-get. These will be flagged as errors during the pip installation if they're necessary. Possible dependencies may include BLAS, LAPACK, ATLAS, various compilers, etc. Whether these are already installed will depend on what you've already done with your system.
Related
I have seen people using pip install docker-py or pip install 'molecule[docker]'.
I believe they are similar (equivalent?)
I read https://molecule.readthedocs.io/en/stable/getting-started.html
which says :
Molecule requires an external Python dependency for the Docker driver which is provided when installing Molecule using pip install 'molecule[docker]'.
so is the molecule[docker] one better in some way ?
pip install molecule[docker] is special pip syntax to say "install the molecule package, with its additional docker option". Using this is almost certainly better than installing molecule with no additional options, and then trying to manually install its Docker dependencies separately.
My guess would be that pip install docker-py install the library globally, or installs the entire library.
Whereas pip install molecule[docker] either only installs the necessary bits for molecule, or it installs it specifically in a molecule location.
I'm more inclined to believe it's the first option - that it saves on space and resources by only installing what is necessary. But that is just my guess.
I was informed that if I have installed anaconda to organize python then I would better install using:
conda install mypackage
rather than
pip3 install mypackage
Is that true? if that is true, can anyone tell some reason for that? version inconsistent or hard to maintain?
You can install your packages with both conda and pip, all of them would work well. The only difference is that conda is Anaconda's package manager, while pip is Python package manager, so there could be some version incompabilities between the packages, installed from different packages into one virtual environment.
Actually there are some difference here:
conda install will install package in your venv environment when you are install under some environment.which may be some thing like: d:/.../venv
while
pip install will install package in some system folder, in my computer is like c:/users/.../
you can definitely change the order of the path in your sys.path to decide which version of package you can use, if you have more than one version installed(if you install numpy
using both conda install and pip install then you may get two versions in two different folders)
There may be some way to put the installed package from pip also in venv folder, I am trying to find it.
I used sudo apt-get install python-scipy to install scipy. This put all the files in /usr/lib/python2.7.dist-packages/scipy. My best guess is it chose that location because python 2.7 was the default version of python. I also want to use scipy with python 3 however. Does the package need to be rebuilt for python 3 or can I just point python 3 to the existing version?
I've tried using pip to install two parallel version, but I can't get the dependency libblas3 installed for my system.
What's the best way to do this?
I'm on Debian Jessie.
To install scipy for python3.x the on a debian-based distribution:
sudo apt-get install python3-scipy
This corresponds to the python2.x equivalent:
sudo apt-get install python-scipy
On a more platform-independent note, pip is the more standard way of installing python packages:
pip install --user scipy #pip install using default python version
To make sure you are using the right pip version you can always be more explicit:
pip2 install --user scipy # install using python2
pip3 install --user scipy # install using python3
Also, I believe anaconda or the more lightweight miniconda were intended to make installation of python packages with complex dependencies more easy, plus it allows for using an environment, making it easier to have several configurations with non-compatible versions etc. This would create+use a python binary different from the one on your system though.
One would then install scipy using the command conda:
conda install scipy
If installing scipy for a specific version you would create an environment with that python version:
conda create -n my_environment_name python=3 scipy
One could also use pip inside a conda environment alongside conda python packages, but I would make sure that you are using pip installed using conda to avoid conflicts. An added benefit when installing conda for a user, is that you don't have to add the --user flag when installing with pip.
If you can't find python3-scipy using apt-get you can use pip to install it for python3, you just have to make sure you use pip3 (if you don't have it apt install python3-pip
pip3 install --user scipy
You may want to try with pip3 install scipy
I have read elsewhere that brew is a better option than pip to install packages (and indeed I had less problems installing Python packages with brew than with pip). The problem is that when I run
brew update && brew outdated && brew upgrade --all
and then
pip-review -a
it seems like the same packages are installed twice (for example matplotlib, scipy, and the like).
How can I get rid of pip and switch entirely to brew, as to avoid double installations and potential conflicts?
You can't do that. You cannot expect all python packages available via brew.
pip is the python package manager, having an understanding of how the python packages should be installed by querying a remote server of python packages called PyPI.
Brew, on the other hand, is a general software installation system for your Mac. It is a project into existence only because Apple is lazy to provide a good package manager and package management system for installing Unix/ Mac software on Apple.
There are many Python packages which exist on brew as volunteers took the pain to convert it to brew formulae. But it certainly does not guarantee of 100% 1-1 mapping of brew package to pip installable package.
You still want to use pip, you just should be using Homebrew's copy of it, rather than some other variant. Homebrew's copy of pip is part of the python package, so if you brew install python you'll have pip all setup and ready to go.
To clean up any non-Homebrew-provided pip packages, just delete the folder the module is in directly. For example, if you manually installed pip, the modules are probably stored under /Library/Python/2.7/site-packages somewhere.
I'm trying to create required libraries in a package I'm distributing. It requires both the SciPy and NumPy libraries.
While developing, I installed both using
apt-get install scipy
which installed SciPy 0.9.0 and NumPy 1.5.1, and it worked fine.
I would like to do the same using pip install - in order to be able to specify dependencies in a setup.py of my own package.
The problem is, when I try:
pip install 'numpy==1.5.1'
it works fine.
But then
pip install 'scipy==0.9.0'
fails miserably, with
raise self.notfounderror(self.notfounderror.__doc__)
numpy.distutils.system_info.BlasNotFoundError:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
How do I get it to work?
This worked for me on Ubuntu 14.04:
sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
pip install scipy
you need the libblas and liblapack dev packages if you are using Ubuntu.
aptitude install libblas-dev liblapack-dev
pip install scipy
I am assuming Linux experience in my answer; I found that there are three prerequisites to getting pip install scipy to proceed nicely.
Go here: Installing SciPY
Follow the instructions to download, build and export the env variable for BLAS and then LAPACK. Be careful to not just blindly cut'n'paste the shell commands - there will be a few lines you need to select depending on your architecture, etc., and you'll need to fix/add the correct directories that it incorrectly assumes as well.
The third thing you may need is to yum install numpy-f2py or the equivalent.
Oh, yes and lastly, you may need to yum install gcc-gfortran as the libraries above are Fortran source.
Since the previous instructions for installing with yum are broken here are the updated instructions for installing on something like fedora. I've tested this on "Amazon Linux AMI 2016.03"
sudo yum install atlas-devel lapack-devel blas-devel libgfortran
pip install scipy
I was working on a project that depended on numpy and scipy. In a clean installation of Fedora 23, using a python virtual environment for Python 3.4 (also worked for Python 2.7), and with the following in my setup.py (in the setup() method)
setup_requires=[
'numpy',
],
install_requires=[
'numpy',
'scipy',
],
I found I had to run the following to get pip install -e . to work:
pip install --upgrade pip
and
sudo dnf install atlas-devel gcc-{c++,gfortran} subversion redhat-rpm-config
The redhat-rpm-config is for scipy's use of redhat-hardened-cc1 as opposed to the regular cc1
On windows python 3.5, I managed to install scipy by using conda not pip:
conda install scipy
What operating system is this? The answer might depend on the OS involved. However, it looks like you need to find this BLAS library and install it. It doesn't seem to be in PIP (you'll have to do it by hand thus), but if you install it, it ought let you progress your SciPy install.
in my case, upgrading pip did the trick. Also, I've installed scipy with -U parameter (upgrade all packages to the last available version)