installed patsy, still can't install statsmodels - python

When I do pip install statsmodels it gives me ImportError: statsmodels requires patsy. http://patsy.readthedocs.org, but then I run pip install patsy and it says its successful, but running pip install statsmodels still gives me same error about requiring patsy.
How can this be?
$ sudo pip install patsy
Requirement already satisfied (use --upgrade to upgrade): patsy in /Library/Python/2.7/site-packages/patsy-0.3.0-py2.7.egg
Requirement already satisfied (use --upgrade to upgrade): numpy in /Library/Python/2.7/site-packages/numpy-1.8.2-py2.7-macosx-10.9-intel.egg (from patsy)
Cleaning up...
$ sudo pip install statsmodels
Downloading/unpacking statsmodels
Downloading statsmodels-0.5.0.tar.gz (5.5MB): 5.5MB downloaded
Running setup.py (path:/private/tmp/pip_build_root/statsmodels/setup.py) egg_info for package statsmodels
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 463, in <module>
check_dependency_versions(min_versions)
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 122, in check_dependency_versions
raise ImportError("statsmodels requires patsy. http://patsy.readthedocs.org")
ImportError: statsmodels requires patsy. http://patsy.readthedocs.org
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 463, in <module>
check_dependency_versions(min_versions)
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 122, in check_dependency_versions
raise ImportError("statsmodels requires patsy. http://patsy.readthedocs.org")
ImportError: statsmodels requires patsy. http://patsy.readthedocs.org
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/tmp/pip_build_root/statsmodels
Storing debug log for failure in /Users/Jacob/Library/Logs/pip.log

What the error message doesn't tell you is that the module six not being there is really the problem.
Found this out by doing import patsy and having it fail and tell me that I needed six. So I did pip install six and now the patsy import worked, as did the pip install statsmodels.

For me:
$python3 -m pip install --upgrade patsy
$python3 -m pip install statsmodels
worked!

For anyone still experiencing issues, I highly recommend this site:
Python libraries. I'm using Python 3, so I,
Downloaded the file named: statsmodels‑0.8.0‑cp35‑cp35m‑win_amd64.whl
Opened windows command prompt
Went to my Downloads directory (cd Downloads)
And then used pip (pip install statsmodels‑0.8.0‑cp35‑cp35m‑win_amd64.whl)

I also had an issue with this in Python 3.4. It worked using the WHL statsmodel file at this link: https://pypi.python.org/pypi/statsmodels#downloads
After the download I installed it using: pip3.4 install my_directory\statsmodels-0.8.0rc1-cp34-none-win_amd64.whl, where my_directory is where I put the WHL file.

Related

ModuleNotFoundError: No module named 'setuptools_rust' when installing packages [duplicate]

This question already has an answer here:
Not able to install django-allauth in ubuntu 18.04.6 LTS
(1 answer)
Closed 8 months ago.
I'm trying to install paramiko using pip package on centos7 OS and getting issues like as below and installed python3 with below command
yum install -y python3
[root#test ~]# pip3 install paramiko
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting paramiko
Using cached https://files.pythonhosted.org/packages/04/e5/39ec73dd4a8769d6759b8d6c60a1b2c9337f585407c2ae8bfb8ccb734278/paramiko-2.11.0-py2.py3-none-any.whl
Collecting cryptography>=2.5 (from paramiko)
Using cached https://files.pythonhosted.org/packages/51/05/bb2b681f6a77276fc423d04187c39dafdb65b799c8d87b62ca82659f9ead/cryptography-37.0.2.tar.gz
Complete output from command python setup.py egg_info:
=============================DEBUG ASSISTANCE==========================
If you are seeing an error here please try the following to
successfully install cryptography:
Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
=============================DEBUG ASSISTANCE==========================
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ccbam6fs/cryptography/setup.py", line 14, in <module>
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ccbam6fs/cryptography/
Just need to Upgrade pip package
pip3 install --upgrade pip
or
pip install --upgrade pip

unable to install pyttsx3 (text to speak module )

I am unable to install pyttsx3 package using pip.
I tried pip install pyttsx3 but was unable to install it.
C:\Users\yashr\Desktop\SOFTWARES\brother> pip install pyttsx3
Collecting pyttsx3
Using cached https://files.pythonhosted.org/packages/f4/20/f6c582c5f2735ca5c55ae52f1ddbc7447fb3565b5ac2fdc24a8d534f4aa1/pyttsx3-2.84-py3-none-any.whl
Collecting pyobjc>=2.4 (from pyttsx3)
Using cached https://files.pythonhosted.org/packages/b1/c9/83b256bb7f771a9e4232518005d6f237ae79215283cf5ea234141751b36a/pyobjc-6.1-py3-none-any.whl
Collecting comtypes; "win32" in sys_platform (from pyttsx3)
Using cached https://files.pythonhosted.org/packages/fb/b8/f8aa21774acb4535e32f6a89055876ca497ff806f9b1b1912b469284a61e/comtypes-1.1.7.zip
Collecting pyobjc-framework-WebKit==6.1 (from pyobjc>=2.4->pyttsx3)
Using cached https://files.pythonhosted.org/packages/f1/64/353b9512c0dddb0159a17a231a9e3bdb594d7d891ffd74d0b26ee629d7b3/pyobjc-framework-WebKit-6.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\yashr\AppData\Local\Temp\pip-install-hxvtccap\pyobjc-framework-WebKit\setup.py", line 27, in <module>
for fn in os.listdir("Modules")
File "C:\Users\yashr\AppData\Local\Temp\pip-install-hxvtccap\pyobjc-framework-WebKit\pyobjc_setup.py", line 408, in Extension
os_level = get_os_level()
File "C:\Users\yashr\AppData\Local\Temp\pip-install-hxvtccap\pyobjc-framework-WebKit\pyobjc_setup.py", line 218, in get_os_level
pl = plistlib.readPlist("/System/Library/CoreServices/SystemVersion.plist")
File "c:\users\yashr\appdata\local\programs\python\python37\lib\plistlib.py", line 99, in readPlist
with _maybe_open(pathOrFile, 'rb') as fp:
File "c:\users\yashr\appdata\local\programs\python\python37\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "c:\users\yashr\appdata\local\programs\python\python37\lib\plistlib.py", line 82, in _maybe_open
with open(pathOrFile, mode) as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\yashr\AppData\Local\Temp\pip-install-hxvtccap\pyobjc-framework-WebKit\
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I would appreciate some help regarding the installation of pyttsx3 package.
Try the following command:
pip install git+git://github.com/nateshmbhat/pyttsx3.git
From here.
If you are on a mac then try pip3 install pyttsx3 . If you are on windows then try pasting this into the terminal - pip install git+git://github.com/nateshmbhat/pyttsx3.git
If that doesn't work - then check the PyPa Documentation and they will explain in a much better way .
Please use below command.
conda install -c auto pyttsx

six cannot be imported/uninstalled/reinstalled/upgraded

I'm trying to run lldb on my MacBook terminal, but I get errors related to the six package:
File "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 98, in <module>
import six
ImportError: No module named six
Traceback (most recent call last):
File "<string>", line 1, in <module>
I tried to launch python from terminal and then execute import six, but still:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named six
Next step was to uninstall and reinstall six, but it seems like everything related to this package is corrupted for me:
$: pip uninstall six
Uninstalling six:
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/commands/uninstall.py", line 59, in run
requirement_set.uninstall(auto_confirm=options.yes)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req.py", line 1035, in uninstall
req.uninstall(auto_confirm=auto_confirm)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req.py", line 598, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req.py", line 1836, in remove
renames(path, new_path)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/util.py", line 295, in renames
shutil.move(old, new)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/_c/lj7t1035563flfh7fy4m3gfh0000gn/T/pip-YQdNMp-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
Storing debug log for failure in /Users/lab5/.pip/pip.log
$: pip install --ignore-installed six
Downloading/unpacking six
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement six
Cleaning up...
No distributions at all found for six
Storing debug log for failure in /Users/lab5/.pip/pip.log
I downloaded six and installed it from the tar.gz file, but it still seems like the old version is installed:
$: pip install --ignore-installed ~/Downloads/six-1.5.1.tar.gz
Unpacking ./Downloads/six-1.5.1.tar.gz
Running setup.py (path:/var/folders/_c/lj7t1035563flfh7fy4m3gfh0000gn/T/pip-zqLhAa-build/setup.py) egg_info for package from file:///Users/lab5/Downloads/six-1.5.1.tar.gz
no previously-included directories found matching 'documentation/_build'
Installing collected packages: six
Running setup.py install for six
no previously-included directories found matching 'documentation/_build'
Successfully installed six
Cleaning up...
$: pip show six
---
Name: six
Version: 1.4.1
Location: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requires:
Python version: Python 2.7.15
Pip version: pip 1.5.6 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)
Do you have any recommendations for me how to get rid of those errors and run lldb properly? I took someone's suggestion to install python again (simply brew install python), but it was not helpful.
You are using python2, to use brew to install python2 you need to add #2
brew install python#2
I use the python2 installed with brew and was able to install six just fine. From your errors, it appears when you tried pip install six you got the OSError: [Errno 1] Operation not permitted:
Try running pip with sudo -H
sudo -H pip install six --upgrade
I'm still not sure what the reasons for the errors were, but I could get rid of them after upgrading my python version and I'm just fine with that.
To install a new python version:
brew install python
Then, I removed the link at /usr/local/bin/python and set it again to the new version:
rm /usr/local/bin/python
ln -s /usr/local/Cellar/python/3.7.0/bin/python3.7 /usr/local/bin/python
Then, installed six with the new version's pip:
python -m pip install six
(executing python -m enforces installing with the new pip, for the new python)
I'm not 100% cool with that solution, I still have to remove old versions to have a clean python installation, but at least I can work with lldb now, which was my main goal
Pointing to the correct Xcode installation using xcode-select -switch solved it for me.

Cannot pip install scipy, mlxtend and math libraries

I am using python 3.5 on windows 10. I am not able to install some libraries like scipy, mlxtend and math.
I have installed and upgraded setuptools and ez_setup following this answer
Python pip install gives "Command "python setup.py egg_info" failed with error code 1"
When I try to pip install scipy and mlxtend I get the following error:
NotFoundError: no lapack/blas resources found
And when I try to install math I get the following error:
Using cached Math-0.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\raisa\AppData\Local\Temp\pip-build-e23g412r\math\setup.py", line 2, in <module>
raise RuntimeError("Package 'Math' must not be downloaded from pypi")
RuntimeError: Package 'Math' must not be downloaded from pypi
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\raisa\AppData\Local\Temp\pip-build-e23g412r\math\
On Windows, you'll want to locate the unofficial binaries here and download the appropriate .whl files for the packages you're wanting to install. Use pip to install and upgrade wheel and setuptools then do pip install the_name_of_the_file.whl
so altogether, assuming you want to install matplotlib and the .whl file is in your current directory...
pip install wheel
pip install --upgrade setuptools
pip install matplotlib‑1.5.3‑cp35‑cp35m‑win32.whl

Error Installing Pyproj in Python 3.5

From last couple of day, I am trying to install the pyproj package of python using pip. But I am getting the below quoted error. I have tried all the relevant solution available but was unable to install it.
Thanks in Advance
C:\Users\ashujaimini\PycharmProjects\untitled1>pip install Pillow
Requirement already satisfied (use --upgrade to upgrade): Pillow in c:\users\ashujaimini\anaconda3\lib\site-packages
C:\Users\ashujaimini\PycharmProjects\untitled1>pip install pyproj
Collecting pyproj
Using cached pyproj-1.9.5.1.tar.gz
Complete output from command python setup.py egg_info:
using bundled proj4..
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ASHUJA~1\AppData\Local\Temp\pip-build-nwtkvc3t\pyproj\setup.py", line 72, in <module>
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
File "c:\users\ashujaimini\anaconda3\lib\distutils\_msvccompiler.py", line 317, in compile
self.initialize()
File "c:\users\ashujaimini\anaconda3\lib\distutils\_msvccompiler.py", line 210, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\ashujaimini\anaconda3\lib\distutils\_msvccompiler.py", line 85, in _get_vc_env
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
**Command "python setup.py egg_info" failed with error code 1 in C:\Users\ASHUJA~1\AppData\Local\Temp\pip-build-nwtkvc3t\pyproj\**
Try this
easy_install pyproj
or
sudo easy_install pyproj
or download the tar file from pyproj and try to run
pip install [path to downloaded tar file]
Pyproj needs a compiler (vcvarsall.bat hints towards a Visual C in Windows), which you don't seem to have installed. Instead of installing from source, I suggest downloading a pre-compiled wheel and install the package from that.
You need dev tools for Python3.5
sudo apt-get update
sudo apt-get install python3.5-dev -y
pip install pyproj
if using Python3.6 need to update the second line.

Categories

Resources