Problem after installing Numpy using pip: poly fit is poorly conditioned - python

I'm trying to install gwsurrogate package and it need Numpy, so I tried to install it using pip and it said it was installed successfully. However I keep getting this error that "Polyfit is poorly conditioned":
>>> % pip3 install gwsurrogate
Collecting gwsurrogate
Using cached gwsurrogate-1.0.6.tar.gz (5.2 MB)
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/setup.py'"'"'; __file__='"'"'/private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-pip-egg-info-xbzt899i
cwd: /private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/
Complete output (10 lines):
init_dgelsd failed init
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/setup.py", line 39, in <module>
import numpy
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 286, in <module>
raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried to uninstall and reinstall Numpy but nothing changed.

Faced this on MacOS 11.1 (Python 3.9.1) while installing numpy as camelot/excalibur dependency. Got it fixed by first upgrading pip latest version:
python3 -m pip install --upgrade pip --user
Found the answer from here: macOS Big Sur python3 cannot import numpy due to polyfit error
If this does not help, you might want to describe what OS version you are on for getting more environment specific help.

well, i use windows and with PIP set up, you can use its command line for installing NumPY.
To install NumPy with the package manager for Python 3, run the following command:
pip install numpy
Pip downloads the NumPy package and notifies you it has been successfully installed.
To upgrade Pip on windows, enter the following in command prompt:
python -m pip install --upgrade pip
This command first uninstalls the old version of Pip and then installs the most current version of Pip.
After the installation, you can use the show command to verify whether NumPy is now part of your Python packages. Run the following command:
pip3 show numpy
the output should confirm you have Numpy, which version you are using, as well as where the package is stored.
this should get your NumPy installed on windows. if you want a more step by step breakdown on how to go about this, you can find that here
https://www.thewindowsclub.com/how-to-install-numpy-using-pip-on-windows-10

Related

My Kali linux showing 'No module named importlib' 'from importlib import import_module'

Trying to install build dependencies with pip which is installing in /usr/local/lib/python2.7/dist-packages
As I try to install proceed gives an error
Collecting git+https://github.com/kti/python-netfilterqueue (from -r requirements.txt (line 1))
Cloning https://github.com/kti/python-netfilterqueue to /tmp/pip-req-build-VQbxfT
Running command git clone -q https://github.com/kti/python-netfilterqueue /tmp/pip-req-build-VQbxfT
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 /usr/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpNlNAvr
cwd: /tmp/pip-req-build-VQbxfT
Complete output (4 lines):
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 16, in <module>
from importlib import import_module
ImportError: No module named importlib
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2 /usr/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpNlNAvr Check the logs for full command output.
so I try to install importlib with pip and I still get the same error. Then I install it directly to /usr/lib/python2.7/dist-packages/pip/_vendor/pep517/ using
pip install importlib --target=/usr/lib/python2.7/dist-packages/pip/_vendor/pep517/
because pip has been installing all packages to /usr/local/lib/python2.7/dist-packages,
but I still get the error either way
Assuming you are trying to install python-netfilterqueue.
You can visit github page and see this
The current version of NetfilterQueue requires Python 3.6 or later.
So you can't install this lib for python 2.7
But you can install 0.9.0 as it also stated that
The last version with support for Python 2.7 was 0.9.0.
pip install NetfilterQueue=0.9.0
Try switching to python3 because this will definitely work.
First you have to install cython.
pip install cython
Then after that you need to make sure you install NetfilterQueue from source.
git clone https://github.com/oremanj/python-netfilterqueue
Navigate to the netfilterqueue directory.
cd python-netfilterqueue
Then run this command.
python3 setup.py install
That's it. It should work properly

Error trying to install a library in Python [duplicate]

This question already has answers here:
Unable to install pygame on Python via pip (Windows 10)
(6 answers)
Closed 2 years ago.
I'm trying to install the pygame library of python, to do it I use pip install pygame in the CMD of Windows, but then I get this error.
Collecting pygame
Using cached pygame-1.9.6.tar.gz (3.2 MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\marcg\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcg\\AppData\\Local\\Temp\\pip-install-c1fzrnpr\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcg\\AppData\\Local\\Temp\\pip-install-c1fzrnpr\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\marcg\AppData\Local\Temp\pip-pip-egg-info-07h2j4on'
cwd: C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can anyone help me?
You could try to install wheel before pip install wheel before installing pygame so it use already compiled package instead of trying to build it.
Python 3.8 doesn't support latest 1.9.6 pygame...
Try :
python3 -m pip install pygame==2.0.0.dev6
UPDATE: Windows users please use python instead of python3 and pip instead of pip3
Try pip3 uninstall pygame
and then python3 -m pip install -U pygame==2.0.0 --user
To see if it works, run one of the included examples:
python3 -m pygame.examples.aliens
If you get 'PermissionError: [WinError 5] Access is denied', before starting the command prompt right click and "Run as administrator".
If pip3 is not there, use pip
Make sure pip is updated.
Watch this video
https://www.youtube.com/watch?v=ABe_qpzQu0Q to learn about updating pip
Make sure to Read pygame official docs about windows installation

"ERROR: can't import snack module" printed while running byobu-config

I've installed byobu on my mac os x mojave. 10.14.xx,
however when I run byobu-config the prompt returns the message
ERROR:Could not import the python snack module
I've tried pip3 install snack with no effect.
it gives me the
pip3 install snack
Collecting snack
Using cached snack-0.0.3.tar.gz (155 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/setup.py'"'"'; __file__='"'"'/private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/pip-egg-info
cwd: /private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/setup.py", line 47
print GCC_VERSION
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(GCC_VERSION)?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The correct solution is to install newt, not snack which is a scientific visualization library. The "snack" dependency of newt refers to snack.py file in newt library, not to be confused with the snack library (which is a scientific visualisation library). snack.py offers windowing abilities for byobu-config.
To install using conda, https://anaconda.org/conda-forge/newt
conda install -c conda-forge newt
This worked for me:
sudo zypper in python3-newt
If you're on another distro, try installing python3-newt using your package manager and it should fix the problem.
Old one, I know, but this particular
error is because you were trying to install a Python 2 module with Python 3's Pip. A tell-tale sign is the error being about print statement which is a function in Python 3.
About the error code
According to the Python documentation:
This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value. The names and descriptions are borrowed from linux/include/errno.h, which should be pretty all-inclusive.
Error code 1 is defined in errno.h and means Operation not permitted.
About your error
Your setuptools do not appear to be installed. Just follow the Installation Instructions from the PyPI website.
If it's already installed, try
pip install --upgrade setuptools
If it's already up to date, check that the module ez_setup is not missing. If it is, then
pip install ez_setup
Then try again
pip install snack
If it's still not working, maybe pip didn't install/upgrade setup_tools properly so you might want to try
Refer to original answer:
https://stackoverflow.com/a/36025294/10798048

problems when using pip install

I am not quite experienced using pip. When I tried to install some packages, I had this error and had no idea what that meant. This happened to multiple packages that I tried to install. Any suggestions would be appreciated.
sudo pip install mysql-python
Password:
WARNING: The directory '/Users/yzr/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mysql-python
Downloading MySQL-python-1.2.5.zip (108 kB)
|████████████████████████████████| 108 kB 2.2 MB/s
ERROR: Command errored out with exit status 1:
command: /Users/yzr/opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-install-0kcqh5vw/mysql-python/pip-egg-info
cwd: /private/tmp/pip-install-0kcqh5vw/mysql-python/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/tmp/pip-install-0kcqh5vw/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I’m assuming you are using an Unix system such as Linux or MacOS.
Maybe you are accidentally using the python2.7 version installed on your system.
You can use a specific version of python for pip with:
python3 -m pip install mysql-python
Let me explain myself, every MacOS or Linux system has two Python versions (2.7 and 3.x) by default, and both of those versions has a pip module related to it, in other words, you have a pip module for Python 2.7 and other pip module for Python 3.x.
However, I’m assuming you are using python3 for your project, therefore, you must specify the pip module to use.
Other way to avoid this problem is using a virtual environment manager, such as pipenv or built in virtualenv module.
It looks like your pip package doesn't have the module "ConfigParser" installed. You should be able to install it by running:
pip install ConfigParser
Alternatively, depending on your Python version, try installing mysqlclient instead:
pip install mysqlclient

Error when trying to install pygame on Python 3

I tried installing pygame using
pip install pygame
I tried installing it using Python 3.8 but it outputs the error below.
I also tried installing using Python 3.7 but still no luck.
The error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\asus\appdata\local\programs\python\python38-32\python.exe'
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\pygame\\setup.py'"'"';
__file__='"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\pip-egg-info'
cwd: C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x86"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Use this (I was facing the same issue and it helped me out):
pip install pygame --pre
You can try to install from the Wheel file.
After verifying that you're using python 3.7
python --version # Python 3.7.X
pip install pygame-1.9.6-cp37-cp37m-win_amd64.whl
What kind of OS system are you using? I have no problem to install on python 3.7
(base) $ python3 -m pip install -U pygame --user
Collecting pygame
Downloading https://files.pythonhosted.org/packages/32/37/453bbb62f90feff2a2b75fc739b674319f5f6a8789d5d21c6d2d7d42face/pygame-1.9.6-cp37-cp37m-macosx_10_11_intel.whl (4.9MB)
|████████████████████████████████| 4.9MB 2.7MB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.6
(base) $ python -m pygame.examples.aliens
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
If the problem persists, you should use conda or another environment manager to create new environment and then install the library.
I'm not getting an error when I do this. Have you tried:
pip install pygame
Have you attempted installing with command-prompt or terminal? When I run what you are doing, I don't seem to get a problem.
Additionally, pygame is not compatible with 3.8 yet as it is unstable. Maybe wait a few months until modules are ready to be used with 3.8. Hope this helps, good day.

Categories