This question already has answers here:
Pip install from pypi works, but from testpypi fails (cannot find requirements)
(2 answers)
Closed 2 years ago.
I have done this small package that I want to distribute in my community. It is now on test.pypi and when I want to try to install it, it gives an error that dependencies couldn't be found.
setup.py
...
install_requires=[
'defcon>=0.6.0',
'fonttools>=3.31.0'
]
...
throws this error
ERROR: Could not find a version that satisfies the requirement defcon>=0.6.0 (from sameWidther==0.6) (from versions: none)
ERROR: No matching distribution found for defcon>=0.6.0 (from sameWidther==0.6)
but when I manually install, it works
pip install 'fonttools>=3.6.0'
pip install 'defcon>=0.6.0'
-i URL, or --index-url URL means "use URL for installing packages from exclusively". By passing -i https://test.pypi.org/simple/, you thus prohibit searching and downloading packages from PyPI (https://pypi.org/simple). To use both indexes, use --extra-index-url:
$ python -m pip install --extra-index-url https://test.pypi.org/simple/ sameWidther
I am trying to collect all the wheel files for libffi-dev. Trying the command mentioned below:
pip wheel --wheel-dir=setup libffi-dev
is giving
Collecting libffi-dev
Could not find a version that satisfies the requirement libffi-dev (from versions: )
No matching distribution found for libffi-dev
Thanks in advance :)
libffi-dev is the name of the Ubuntu package. cffi is the one from PyPI. You need to install both:
sudo apt-get install libffi-dev
pip install cffi
If you are trying to install wordcloud and facing this issue.
From https://pypi.org/simple/wordcloud/ download the corresponding .whl file for the Python version and OS you are using. (I have downloaded wordcloud-1.5.0-cp37-cp37m-win_amd64.whl meant for 64 bit windows).
Place the file in C:\Users\<User>
From command prompt run
pip install --verbose --trusted-host files.pythonhosted.org wordcloud-1.5.0-cp37-cp37m-win_amd64.whl
This worked for me. Found this solution after a lot of research.
C:\Users\**<user>**>pip install --verbose --trusted-host files.pythonhosted.org wordcloud-1.5.0-cp37-cp37m-win_amd64.whl
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Created temporary directory: C:\Users\<user>\AppData\Local\Temp\pip-ephem-wheel-cache-hqkva4rs
Created temporary directory: C:\Users\<user>\AppData\Local\Temp\pip-req-tracker-0cimhb2c
Created requirements tracker 'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-req-tracker-0cimhb2c'
Created temporary directory: C:\Users\<user>\AppData\Local\Temp\pip-install-y5b3ck8i
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Processing c:\users\<user>\wordcloud-1.5.0-cp37-cp37m-win_amd64.whl
Added wordcloud==1.5.0 from file:///C:/Users/<user>/wordcloud-1.5.0-cp37-cp37m-win_amd64.whl to build tracker 'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-req-tracker-0cimhb2c'
Removed wordcloud==1.5.0 from file:///C:/Users/<user>/wordcloud-1.5.0-cp37-cp37m-win_amd64.whl from build tracker 'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-req-tracker-0cimhb2c'
Requirement already satisfied: pillow in c:\users\<user>\anaconda3\lib\site-packages (from wordcloud==1.5.0) (5.4.1)
Requirement already satisfied: numpy>=1.6.1 in c:\users\<user>\anaconda3\lib\site-packages (from wordcloud==1.5.0) (1.15.1)
Installing collected packages: wordcloud
Successfully installed wordcloud-1.5.0
Cleaning up...
Removed build tracker 'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-req-tracker-0cimhb2c'
I am trying to install python packages from the local file system with pip as discussed in this question.
I have used pip2pi as suggested in the accepted answer in the above question.
dmanna#ubuntu:~$ mkdir -p pyt/pkg
dmanna#ubuntu:~$ pip2tgz pyt/pkg/ patroni[zookeeper]
The downloaded packages
dmanna#ubuntu:~$ ls /home/dmanna/pyt/pkg/
cdiff-1.0.tar.gz
certifi-2018.4.16-py2.py3-none-any.whl
chardet-3.0.4-py2.py3-none-any.whl
click-6.7-py2.py3-none-any.whl
idna-2.7-py2.py3-none-any.whl
kazoo-2.5.0-py2.py3-none-any.whl
patroni-1.4.4.tar.gz
prettytable-0.7.2.tar.bz2
psutil-5.4.6.tar.gz
psycopg2-2.7.4.tar.gz
python_dateutil-2.7.3-py2.py3-none-any.whl
pytz-2018.4-py2.py3-none-any.whl
PyYAML-3.12.tar.gz
requests-2.19.1-py2.py3-none-any.whl
six-1.11.0-py2.py3-none-any.whl
tzlocal-1.5.1.tar.gz
urllib3-1.23-py2.py3-none-any.whl
Then when I am trying to install the required package from the above local directory. It is giving me the below error
dmanna#ubuntu:~$ sudo pip install --no-index --find-links=pyt/pkg/patroni-1.4.4.tar.gz patroni[zookeeper]
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking patroni[zookeeper]
Running setup.py (path:/tmp/pip_build_root/patroni/setup.py) egg_info for package patroni
Installing extra requirements: 'zookeeper'
Downloading/unpacking urllib3>=1.19.1,!=1.21 (from patroni[zookeeper])
Could not find any downloads that satisfy the requirement urllib3>=1.19.1,!=1.21 (from patroni[zookeeper])
Cleaning up...
No distributions at all found for urllib3>=1.19.1,!=1.21 (from patroni[zookeeper])
Storing debug log for failure in /home/dmanna/.pip/pip.log
Can someone let me know what I am doing wrong?
Python - 2.7.6
PIP - 1.5.4
Ubuntu 14.04
--find-links=pyt/pkg
Find links in the directory, not in the patroni-1.4.4.tar.gz archive.
I am trying to install the gmpy2 package as its an requirement for the PHE package. As suggested in "GMPY2 not installing", I have tried to install it via pre-compliled binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/.
However when I try to install it via
pip install gmpy2-2.0.8-cp36-cp36m-win32.whl
I get the following result:
C:\Users\adria\Desktop>pip install gmpy2-2.0.8-cp36-cp36m-win32.whl
Requirement 'gmpy2-2.0.8-cp36-cp36m-win32.whl' looks like a filename, but the file does not exist
Processing c:\users\adria\desktop\gmpy2-2.0.8-cp36-cp36m-win32.whl
Exception:
Traceback (most recent call last): (...)
Is it a problem that the download from http://www.lfd.uci.edu/~gohlke/pythonlibs/ is saved as zip file?
I use Python 3.6.3 on Win10.
If you try to install without specifying the file extension (i,e : pip install gmpy2-2.0.8-cp36-cp36m-win_amd64) it won't work cause it will try to download the package from pypi repository:
C:\Users\bobolafrite\Downloads>pip install gmpy2-2.0.8-cp36-cp36m-win_amd64
Collecting gmpy2-2.0.8-cp36-cp36m-win_amd64
Could not find a version that satisfies the requirement gmpy2-2.0.8-cp36-cp36m-win_amd64 (from versions: )
No matching distribution found for gmpy2-2.0.8-cp36-cp36m-win_amd64
But if you try with the extension (i,e : pip install gmpy2-2.0.8-cp36-cp36m-win_amd64.whl)
C:\Users\bobolafrite\Downloads>pip install gmpy2-2.0.8-cp36-cp36m-win_amd64.whl
Processing c:\users\bobolafrite\downloads\gmpy2-2.0.8-cp36-cp36m-win_amd64.whl
Installing collected packages: gmpy2
Successfully installed gmpy2-2.0.8
If I simply do:
import lightgbm as lgb
I'm getting
python script.py
Traceback (most recent call last):
File "script.py", line 4, in <module>
import lightgbm as lgb
File "/usr/local/lib/python2.7/site-packages/lightgbm/__init__.py", line 8, in <module>
from .basic import Booster, Dataset
File "/usr/local/lib/python2.7/site-packages/lightgbm/basic.py", line 31, in <module>
_LIB = _load_lib()
File "/usr/local/lib/python2.7/site-packages/lightgbm/basic.py", line 26, in _load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 440, in LoadLibrary
return self._dlltype(name)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 362, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/python2.7/site-packages/lightgbm/lib_lightgbm.so, 6): Library not loaded: /usr/local/opt/gcc/lib/gcc/7/libgomp.1.dylib
Referenced from: /usr/local/lib/python2.7/site-packages/lightgbm/lib_lightgbm.so
Reason: image not found
I seem to have everything installed correct:
python -m pip install lightgbm
Requirement already satisfied: lightgbm in /usr/local/lib/python2.7/site-packages
Requirement already satisfied: wheel in /usr/local/lib/python2.7/site-packages (from lightgbm)
Requirement already satisfied: scikit-learn in /usr/local/lib/python2.7/site-packages (from lightgbm)
Requirement already satisfied: scipy in /usr/local/lib/python2.7/site-packages (from lightgbm)
Requirement already satisfied: numpy in /usr/local/lib/python2.7/site-packages (from lightgbm)
I do have a 6 folder in my GCC folder. Should I need to install another version of GCC for this to work?
All the above answers didn't work for me.
On Mac, if I installed the libomp using brew fixed the problem: Refer: link
brew install libomp
I find a similar problem here LightGBM
The answer and comment may help you.
Build LightGBM in Mac:
brew install cmake
brew install gcc --without-multilib
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build
cmake ..
make -j
Then install:
cd ../python-packages
sudo python setup.py install --precompile
As stated by #ecodan, you might need to force Mac to use GCC and G++ instead of the default compiler. So instead of building with cmake .., try:
cmake -DCMAKE_C_COMPILER=/usr/local/Cellar/gcc/6.1.0/bin/gcc-6 -DCMAKE_CXX_COMPILER=/usr/local/Cellar/gcc/6.1.0/bin/g++-6 ..
ajusting the versions to match yours.
I had the same exact problem on M1 MAC. I have tried to import it through Jupiter notebook. This command solved the problem:
conda install lightgbm
On MAC you need to install open-mpi:
brew install open-mpi
Same error, different source: seems like I had the gcc 8 version installed, and it needs gcc 7.
It worked by switching it back to last gcc 7 version:
brew switch gcc 7.3.0_1
For users with macports, replace the beginning of the brew solution with:
port install gcc7 cmake
export CXX=g++-mp-7 CC=gcc-mp-7
On MacOS High Sierra with MacPorts installed, I did the following:
Install clang-5.0 using MacPorts
Inside the /build directory, run
cmake -DCMAKE_CXX_COMPILER=clang++-mp-5.0 -DCMAKE_C_COMPILER=clang-mp-5.0 ..
To build the python package, go to /python_package directory and modify the setup.py script.
You need to modify the function compile_cpp() at the very end that checks the case for other OS (including Mac). Before the silent_call(...), add the following two lines:
cmake_cmd.append("-DCMAKE_CXX_COMPILER=clang++-mp-5.0")
cmake_cmd.append("-DCMAKE_C_COMPILER=clang-mp-5.0")
Run sudo python setup.py install. Enjoy
I used this command generated from PyCharm and it worked for me.
conda install -p { < =replace with USER_HOME_DIR>}/anaconda3 lightgbm -y
Note : i tried Brew and pip install but they didn't work for me as Azure ML studio already downloaded other versions of LightGBM that were causing conflict in upgrading to correct packages.
conda install -c conda-forge lightgbm