My package depends on both numpy and statsmodels and I have them listed in my setup.py script under install_requires:
SETUP_REQUIRES = [
'numpy',
]
INSTALL_REQUIRES = [
'numpy',
'statsmodels>=0.5.0',
]
setup(name=DISTNAME,
author=AUTHOR,
author_email=EMAIL,
version=VERSION,
packages=PACKAGES,
package_data=PACKAGE_DATA,
include_package_data=INCLUDE_PACKAGE_DATA,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
license=LICENSE,
url=URL,
download_url=DOWNLOAD_URL,
classifiers=CLASSIFIERS,
setup_requires=SETUP_REQUIRES,
install_requires=INSTALL_REQUIRES,
scripts = SCRIPTS,
)
but whenever I run pip install mypackage it fails to install statsmodels because it says it requires numpy.
Collecting statsmodels>=0.5.0 (from mypackage)
Downloading statsmodels-0.8.0rc1.zip (9.9MB)
100% |████████████████████████████████| 9.9MB 217kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-nkf7ym2k/statsmodels/setup.py", line 330, in <module>
from numpy.distutils.misc_util import get_info
ImportError: No module named 'numpy'
Is there a way to have it install numpy first? Or check for inter-package dependencies?
Related
I need installing pyenchant v1.6.7 on MacBook with Apple Silicon (M1 Pro) for Python 2.7.18.
This package is a wrapper for C-library enchant, so it requires to the enchant was installed firstly. Well, I've installed the enchant by: brew install enchant.
However, when I try to install pyenchant using PIP I got the next error:
cwd: /private/var/folders/8t/b2kn5tm162s614gvsfrdcbhm0000gn/T/pip-install-8FO32O/pyenchant/
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8t/b2kn5tm162s614gvsfrdcbhm0000gn/T/pip-install-8FO32O/pyenchant/setup.py", line 210, in <module>
import enchant
File "enchant/__init__.py", line 92, in <module>
from enchant import _enchant as _e
File "enchant/_enchant.py", line 145, in <module>
raise ImportError(msg)
ImportError: The 'enchant' C library was not found. Please install it via your OS package manager, or use a pre-built binary wheel from PyPI.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Also I have tried to specify LDFLAGS and CFLAGS:
LDFLAGS='-L/opt/homebrew/Cellar/enchant/2.3.3/lib' CFLAGS="-I/opt/homebrew/Cellar/enchant/2.3.3/include" ~/.pyenv/versions/2.7.18/bin/pip install --no-cache-dir pyenchant==1.6.7
But it doesn't work, I still get the same error.
How to specify the enchant library for the pyenchant module?
I had installed biopython but when I check for it.
It returns no module found
pip3 install biopython
Requirement already satisfied: biopython in
Requirement already satisfied: numpy in
python3
Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52)
import Bio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Bio'
I'm trying to use pyarrow.cuda. But after installation of pyarrow by conda or pip I get following error:
>>> import pyarrow.cuda
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/b1es/miniconda3/envs/seismic/lib/python3.6/site-packages/pyarrow/cuda.py", line 22, in <module>
from pyarrow._cuda import (Context, IpcMemHandle, CudaBuffer,
ModuleNotFoundError: No module named 'pyarrow._cuda'
This is a fresh conda environment created in following way:
$ conda create -n seismic -c conda-forge python numpy scipy sympy matplotlib numba pandas pillow pyspark tqdm pyarrow
...
$ conda activate seismic
$ python -c 'from numba import cuda ; print(cuda.current_context())'
<CUDA context c_void_p(93844987691120) of device 0>
$ python -c 'import pyarrow ; print(pyarrow.__version__)'
0.14.1
$ python -c 'import pyarrow.cuda'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/b1es/miniconda3/envs/seismic/lib/python3.7/site-packages/pyarrow/cuda.py", line 22, in <module>
from pyarrow._cuda import (Context, IpcMemHandle, CudaBuffer,
ModuleNotFoundError: No module named 'pyarrow._cuda'
I also created a fresh conda env where pyarrow was installed from pip, result was the same.
I'm trying to install the bitstream Python package via pip on my windows7 machine. But it fails with:
Q:\python>pip install bitstream
Collecting bitstream
Using cached bitstream-2.4.0.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\vm\AppData\Local\Temp\pip-build-jdkts06o\bitstream\setup.py", line 5, in <module>
import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\vm\AppData\Local\Temp\pip-build-jdkts06o\bitstream\
But ConfigParser is already installed !
Q:\python>pip install configparser
Requirement already satisfied: configparser in c:\users\vm\appdata\local\programs\python\python36-32\lib\site-packages
bitstream is Python 2.7 only, do not install it with Py 3.6.
I'm having issues installing broken link-checker.
When I do 'sudo pip install LinkChecker' like said in installation, I get following error
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-uBq7xh/LinkChecker/setup.py", line 95, in <module>
import py2app
File "/Library/Python/2.7/site-packages/py2app/__init__.py", line 31, in <module>
__version__ = pkg_resources.require('py2app')[0].version
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 968, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'macholib>=1.4' distribution was not found and is required by py2app
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-uBq7xh/LinkChecker/
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The error message you get suggests you fail to meet the dependencies needed for the package you're installing.
Try installing macholib and upgrading pip, as suggested by the log
pip install macholib
pip install --upgrade pip