I am downloading rasa core and the NLU. But installing rasa core is presenting a frustrating error I do not understand.
pip install rasa_core
Results in an error
Installing collected packages: pyparsing, kiwisolver, matplotlib, rasa-nlu, graphviz, redis, fakeredis, decorator, networkx, fbmessenger, click, itsdangerous, flask, jsonpickle, h5py, Keras, tzlocal, apscheduler, websocket-client, slackclient, python-telegram-bot, ply, pandoc, packaging, snowballstemmer, alabaster, sphinxcontrib-websupport, babel, imagesize, sphinx, nbsphinx, monotonic, humanfriendly, coloredlogs, docopt, pykwalify, ConfigArgParse, ruamel.ordereddict, ruamel.yaml, rasa-core
Found existing installation: pyparsing 1.5.6
Cannot uninstall 'pyparsing'. 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.
I can not find any information on this error or a work around?
My python version is 2.7 but I don't think that would make a difference.
I also don't under stand why it would want to uninstall the package to then re install it (Upgrade?).
Either remove the package manually or overwrite it:
pip install pyparsing --ignore-installed
If you want to uninstall python package which is part of distutils, you can manually remove the folder from 'site-packages' folder. If it is Anaconda distribution, it will be in following folder. I suggest to cut the folder and paste it somewhere else for backup purpose.
C:\Users\<WindowsUser>\AppData\Local\Continuum\Anaconda3\Lib\site-packages
Following 2 items needs to be removed.
Folder [package version no.]
File - [package>.egg-info]
Related
This is a followup to this question
Installing a pip package with cupy as a requirement puts install in never ending loop
Where somehow a pip package was not able to detect that cupy is already installed, and tried to re-install it.
The solution given was to use
try:
import cupy
except Exception:
install_requires.append('cupy')
Which worked for when I tried to install through github with
!pip install https://github.com/Santosh-Gupta/SpeedTorch/archive/master.zip
However, when I uploaded by code to pip and tried to run it, it's re-installing cupy again
!pip install SpeedTorch
I am using Goolgle colab, which already has cupy installed. For convenience, here's a link to the notebook I am using
https://colab.research.google.com/drive/17KrdcHh29cpFMel_oYnOTkA1dNElolZ1
And here is my setup.py file
https://github.com/Santosh-Gupta/SpeedTorch/blob/master/setup.py
This problem may be unique to cupy, since I do not have this issue with other python packages.
This is not issue specific to CuPy. You should not modify install_requires in setup.py if you want to distribute your package as a wheel. setup.py runs when building a wheel package, not when installing it. In other words, install_requires is determined depending on whether cupy is available when building a wheel package.
This question already has answers here:
Pip install from pypi works, but from testpypi fails (cannot find requirements)
(2 answers)
Closed 2 years ago.
TL;DR Even though I've specified dependencies with install_requires in setup.py, the install through pip fails because some dependencies can't be found.
I've developed a package which I intend to distribute via PyPi. I've created a built distribution wheel and uploaded it to testPyPI to see if everything is working with the upload and if the package can be installed from a user perspective.
However, when I try to pip install the package inside a vanilla python 2.7 environment, the installation process fails while installing the dependencies.
My package depends on these packages (which I added to the setup.py file accordingly):
...
install_requires=['numpy','gdal','h5py','beautifulsoup4','requests','tables','progress'],
...
So when I run pip install, everything looks normal for a moment, until I receive this error:
Could not find a version that satisfies the requirement progress (from #NAME#) (from versions: )
No matching distribution found for progress (from #NAME#)
When I remove the progress dependency (I could live without it), same thing happens for pytables:
Could not find a version that satisfies the requirement tables (from #NAME#) (from versions: )
No matching distribution found for tables (from #NAME#)
If I run pip install tables and pip install progress manually beforehand, everything works as expected.
So how can I assure that if someone downloads my package, all missing dependencies are installed with it?
Related bonus question:
Can I include a wheel file in my package (maybe through MANIFEST.in) and install it as dependency if the module is not available? If so, how?
And I think I've found the answer to my question myself.
When installing a package from testPyPI, the dependencies are also installed from there. And it seems, that while there are many packages available, pytables and progress are apparently missing. This caused the installation to fail.
Naturally, manually installing with pip install gets the package from the "normal" PyPi, which of course works. This obviously added to my confusion.
Here's a look at the output from pip install when installing the package from the testPyPi:
Downloading https://test-files.pythonhosted.org/packages/4f/96/b3329750a04fcfc316f15f658daf6d81acc3ac61e3db390abe8954574c18/nump
y-1.9.3.tar.gz (4.0MB)
while installing the wheel directly, it looks slightly different:
Downloading https://files.pythonhosted.org/packages/2e/91/504e434d3b95d943caab926f33dee5691768fbb622bc290a0fa6df77e1d8/numpy-1.1
4.2-cp27-none-win32.whl (9.8MB)
Additionally, running
pip install --index-url https://test.pypi.org/simple/ tables
produces the same error as described in my question.
The installation information page of PyCryptodome says the following under the "Windows (pre-compiled)" section:
Install PyCryptodome as a wheel:
pip install pycryptodomex
To make sure everything works fine, run the test suite:
python -m Cryptodome.SelfTest
There are several problems with this though:
Contrary to what these instructions say, this will not install PyCryptoDome as a wheel, but it will rather download it and try to build it, resulting in an error if you don't have the correct build environment installed for the C components included in this package (and the entire mess related to this is the biggest benefit of using a wheel instead to begin with).
Even if I instead download the correct wheel file from PyCryptoDome's PyPi page, I must (as far as I know?) instead use a command-line as follows to install it:
pip install c:\some\path\name-of-wheel-file.whl
This in turn makes it install under the default "Crypto" package instead of the "Cryptodome" package explicitly mentioned in the instructions (and therefore colliding in a breaking fashion with any pre-existing installations of the PyCrypto package).
So, my question is:
Is there any way to install a wheel file under a different package name than the default one?
PyCryptodome does not seem to provide any specific wheel files for installing under this alternative package name, so if this is impossible, I have a big problem (because I already have PyCrypto installed). :-(
PS.
Some more context regarding the need for the alternative package name can be provided by the following quote from the same installation page that is linked above:
PyCryptodome can be used as:
1.
a drop-in replacement for the old PyCrypto library. You install it with:
pip install pycryptodome
In this case, all modules are installed under the Crypto package. You can test everything is right with:
python -m Crypto.SelfTest
One must avoid having both PyCrypto and PyCryptodome installed at the same time, as they will interfere with each other.
This option is therefore recommended only when you are sure that the whole application is deployed in a virtualenv.
2.
a library independent of the old PyCrypto. You install it with:
pip install pycryptodomex
You can test everything is right with:
python -m Cryptodome.SelfTest
In this case, all modules are installed under the Cryptodome package. PyCrypto and PyCryptodome can coexist.
So, again, all I want is to install it as described under alternative 2 in this quote, from a wheel file, but the problem is that the provided wheel files seem to only default to the package name described under alternative 1 in this quote (i.e. "Crypto").
As far as I know this is not possible. The only way to achieve this by recompiling the wheel yourself after you modified its name in the setup.py.
I have a project that has python-xlib as a requirement. Unfortunately python-xlib is not on pypi, so in my requirements file I use:
svn+https://python-xlib.svn.sourceforge.net/svnroot/python-xlib/tags/xlib_0_15rc1/ as per this advice:
How do you install Python Xlib with pip?
This works fine with pip, but I want to package it with setup.py. Only actual eggs are allowed in install_requires, so this answer:
How can I make setuptools install a package that's not on PyPI?
suggests using dependency_links, which I did.
svn+https did not work in a dependency_link, so instead I link to the tarball referenced from this page: http://python-xlib.svn.sourceforge.net/viewvc/python-xlib/tags/xlib_0_15rc1/
. This tarball gets downloaded the way I expect it to, but when it is time to install it, I get:
Searching for pyxlib
Best match: pyxlib [unknown version]
Downloading http://python-xlib.svn.sourceforge.net/viewvc/python-xlib/tags/xlib_0_15rc1/?view=tar#egg=pyxlib
Processing xlib_0_15rc1
error: /tmp/easy_install-BDFVH3/xlib_0_15rc1/COPYING: Not a directory
I don't get it. Of course COPYING is not a directory. Why does setuptools (or is it distutils?) not run the setup.py that is in the python-xlib root? I suspect this must all be quite easy. How do I include python-xlib as a dependency for my egg?
I'm building a small app that uses PyQt and tought it'd be nice to declare that dependency in setup.py.
However, according to this blog (first hit on google for pyqt setuptools) says it can't be done, and the last paragraph here doens't try to do it either.
Ideas? Perhaps I should switch to PySide which is on PyPi?
Update:
The obvious install_requires = [ 'pyqt >= 0.7' ] in setup.py gives me:
D:\3rd\BuildBotIcon\my-buildboticon\python>setup.py test
running test
install_dir .
Checking .pth file support in .
C:\Python26-32\pythonw.exe -E -c pass
Searching for pyqt>=4.7
Reading http://pypi.python.org/simple/pyqt/
Reading http://www.riverbankcomputing.com/software/pyqt/
Reading http://www.riverbankcomputing.com/software/pyqt/download
No local packages or download links found for pyqt>=4.7
error: Could not find suitable distribution for Requirement.parse('pyqt>=4.7')
Right, the PyQT packages are not using distutils / setup.py for it's installation, so they can't be installed with easy_install or pip. You need to download and install it manually.
That also means you should not put it in your requires metadata, as easy_install and pip then will try to install it and fail.
I don't know if PySide is any good, but is also has not setup.py, and also refuse to install with easy_install/pip, so not a good option. :)
Another option is to repackage PyQt with distutils, but that may be a lot of work.
While you can pip install pyqt5 thanks to the now available wheels (as suggested by #mfitzp), it cannot be required from setup.py via install_requires. The reason is that setuptools doesn't know how to install wheels which pip knows how to, and PyQT5 is only available as wheels on PyPI (there is no source distribution, i.e. no tar.gz file). See this email and that bug report for details.
While the accepted answer was originally correct Python Wheels now provide a means to install C extension packages such as PyQt5 without the need for compilation from source.
PyPi currently has .whl files for PyQt5 on Python3 for multiple platforms, including MacOS X, Linux (any), Win32 and Win64. For example, this is the output when pip-installing PyQt5 on Python3 on a Mac:
mfitzp#MacBook-Air ~ $ pip3 install pyqt5
Collecting pyqt5
Downloading PyQt5-5.6-cp35-cp35m-macosx_10_6_intel.whl (73.2MB)
100% |████████████████████████████████| 73.2MB 2.5kB/s
Collecting sip (from pyqt5)
Downloading sip-4.18-cp35-cp35m-macosx_10_6_intel.whl (46kB)
100% |████████████████████████████████| 49kB 1.8MB/s
Installing collected packages: sip, pyqt5
Successfully installed pyqt5-5.6 sip-4.18
If you are targeting Python3+PyQt5 then you should have no problem specifying PyQt5 as a normal dependency in setup.py.
Setuptools >= 38.2.0 now knows how to install wheels. The trivial answer, therefore, is to install a recent version of setuptools and require that your enlightened userbase does so as well. To enforce usage of setuptools >= 38.2.0 at installation time, see this relevant answer elsewhere.
Since setuptools 38.2.0 was released over a year ago, all prior answers to this question are horrifyingly obsolete, blatantly wrong, and less than useful.