SandboxViolation error when installing statsmodels with easy_install - python

I tried to install statsmodels Python library on a Fedora 19 system. I used easy_install as follows:
easy_install -U statsmodels
But I get the following error while installing:
error: SandboxViolation: os.open('/root/.matplotlib/tmpvjSAwn', 131266, 384) {}
The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.
This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand. Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.
What's wrong here?

In the setup.py in source, add
os.environ["MPLCONFIGDIR"] = "."
after import os
Then I got the following error when I called the
python setup.py install
from the statsmodels directory.
Traceback (most recent call last):
File "setup.py", line 465, in <module>
check_dependency_versions(min_versions)
File "setup.py", line 124, in check_dependency_versions
raise ImportError("statsmodels requires patsy. http://patsy.readthedocs.org")
pasty was missing in the system. So only thing I had to do was installing pasty. using
easy_install --upgrade patsy
then I could install statsmodels from the source in the normal way.

Related

Installing Pip but require setuptools and getting syntax error

Trying to install pip without internet, so I downloaded the tar.gz package from pypi.org and when installing the pip setup file by running "python setup.py install" I get "No Module Named 'Setuptools'".
So I downloaded setuptools.tar.gz from pypi.org and ran the "python setup.py install" but this time I get a syntax error. Python version running is 3.5.2.
Traceback (most recent call last):
File "setup.py", line 7, in <module>
import setuptools
File "/home/insite/setuptools-57.0.0/setuptools/__init__.py", line 18, in <module>
from setuptools.dist import Distribution
File "/home/insite/setuptools-57.0.0/setuptools/dist.py", line 585
license_files: Optional[List[str]] = self.metadata.license_files
^
SyntaxError: invalid syntax
It looks like you're trying to install setuptools 57.0.0 on Python 3.5. As of setuptools 51.0.0,
Breaking Changes
#2435: Require Python 3.6 or later.
You need a version of setuptools that's 50.0.0 or older.
For what it's worth, the specific error you're getting is because of PEP 526, which was added to Python officially in 3.6. But even if you patched that somehow (and I don't recommend trying), you're likely to run into other problems. You just need an older setuptools or a newer Python.
Wrong setuptools version was used. Python 3.5 uses setuptools version 50.0.0 or older. Thanks to Silvio Mayolo.

Python 3.5 pip version conflict with python 2.7

I am trying to install a software using pip install and my python and pip versions are 3.5. but when I run sudo pip install -e . I get the following error.
Traceback (most recent call last):
File "/usr/local/bin/pip3.5", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 2675, in <module>
parse_requirements(__requires__), Environment()
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 552, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==8.1.0
Why Do I get an error with python 2.7 and please some one could sortout my issue.
Your pip version and python versions are separate. It looks like your package requires exactly pip 8.1.0. You have to either upgrade/downgrade to that version first, or modify the software to work with whichever pip you have available.
Also, it may be easier to install the software in a virtual environment rather than system/global one. Changing the system version of pip may break either current apps, or the future pip package updates.

Not able to install the python-module numpy

After hours of trying I'm still not able to install numpy. I READ LOTS OF HINTS, ANSWERS USW. BUT IT DOESN'T HELP.
Furthermore I have windows 7, 32 bit, Python 27.
What I did:
download numpy-1.10.2.zip:
http://sourceforge.net/projects/numpy/files/
unzip it
start the windows command prompt and input:
cd C:\Users\myname\Desktop\numpy-1.10.2
now it appears:
C:\Users\myname\Desktop\numpy-1.10.2>
I input:
python setup.py install
and there appears an error:
Running from numpy source directory.
Traceback (most recent call last):
File "setup.py", line 263, in <module>
setup_package()
File "setup.py", line 246, in setup_pa
import setuptools
ImportError: No module named setuptools
I hope somebody can help me or even better IS THERE NOT EASIER WAY TO INSTALL NUMPY OR OTHER MODULES??
Building numpy from source on windows is non-trivial. Best use official binaries (http://sourceforge.net/projects/numpy/files/NumPy/1.10.2/) or Gohlke binaries (http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) or a distribution like Anaconda or Canopy or WinPython.
You need to install the setuptools package as well. See here.
A more easy way to install python packages is using pip, which resolves package dependencies automatically. See here. Pip should be included in your python installation if you use a recent version.
You should succeed by calling pip install numpy.

installing scipy package in windows

I want to install scipy packages and I know it's a repetitive question, but I have tried all of them but I didn't find a proper solution.
when write this : import scipy
it executes successfully. but when I try this:
import scipy.spatial
I receive this message:
Traceback (most recent call last):
File "C:/Users/Hamid/Documents/kodeyaro/kodefolani.py", line 41, in <module>
from scipy.spatial import Delaunay
File "C:\Python27\lib\site-packages\scipy\spatial\__init__.py", line 92, in module>
from .qhull import *
ImportError: DLL load failed: The specified module could not be found.
what should I do?
below re-installation will fix the issue as required dll will be placed at right place.
user should have admin permissions on the system.
python -m pip install scipy --upgrade --force
I faced this problem when I switched to python38. Build was failing while scipy installation.
I solved by using prebuilt libs from Prof: Gohlke
https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
Install appropriate numpy+mkl version using --force argument
pip install numpy-1.17.3+mkl-cp38-cp38-win_amd64.whl --force
Run this in the cmd:
pip install scipy
It is advisable to run cmd as Adminstrator.

python can't find numpy

I was trying to follow the instruction from this link :http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/
However, it seems my python can not find the Numpy, Scipy and everything I install using pip.
Right now, when I type which python, it shows /usr/local/bin/python.
However, when I type
pip install numpy
it shows
Requirement already satisfied (use --upgrade to upgrade): numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python.
Thus it seems they are in different directory, and probably I installed numpy previously, which makes pip keep telling me they are installed. I wonder is there any way around that ?
update, I have tried to import it.
import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named numpy
I have also tried to uninstall the numpy and install it again. However, when I uninstall it. It still gives me error.
applematoMacBook-Air:~ apple$ pip uninstall numpy
DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling numpy-1.8.0rc1:
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip-6.1.1-py2.7.egg/pip/basecommand.py", line 246, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip-6.1.1-py2.7.egg/pip/commands/uninstall.py", line 70, in run
requirement_set.uninstall(auto_confirm=options.yes)
File "/usr/local/lib/python2.7/site-packages/pip-6.1.1-py2.7.egg/pip/req/req_set.py", line 274, in uninstall
req.uninstall(auto_confirm=auto_confirm)
File "/usr/local/lib/python2.7/site-packages/pip-6.1.1-py2.7.egg/pip/req/req_install.py", line 730, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/lib/python2.7/site-packages/pip-6.1.1-py2.7.egg/pip/req/req_uninstall.py", line 126, in remove
renames(path, new_path)
File "/usr/local/lib/python2.7/site-packages/pip-6.1.1-py2.7.egg/pip/utils/__init__.py", line 292, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
Seems like the version of pip you are using is using the default mac system-wide python interpreter /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python instead of the one installed in /usr/local/bin.
I've pretty much experienced the same issues until I started using homebrew. I'd recommend to have a look at this page on brew and python. You'd might need to remove pip and reinstall it from brew. Btw, using brew, there's no need for sudo.
try: pip uninstall numpy
and then: pip install numpy
...and try it with sudo:
sudo pip install numpy
first, you should use pip list to check out have you installed numpy .
if you already installed, check out your program IDE whether the pycharm, and check the pycharm interpreter does the local interpreter or virtual interpreter. if the interpreter is virtual, you should change to local. if it works, you can create the new project with select the local interpreter.
more detail: https://www.jianshu.com/p/9c3507cca2b9
in my problem, i can't update scikit-learn with pip install -U scikit-learn, and occur the problem
Cannot uninstall 'scikit-learn'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
it occured in your error too. so, i find your problem.
and i try the commod pip install -U --ignore-installed scikit-learn, and it solve my problem.

Categories

Resources