Rasa installation Requirement Incompatible - python

I have a laptop with Windows 10 Pro and I'm trying to install Rasa 1.6.0
When I try to run the command pip install rasa==1.6.0 --no-cache-dir, I get the following error:
Collecting sanic~=19.9
Downloading sanic-19.12.4-py3-none-any.whl (73 kB)
|████████████████████████████████| 73 kB 5.1 MB/s
Downloading sanic-19.12.3-py3-none-any.whl (72 kB)
|████████████████████████████████| 72 kB 2.6 MB/s
Downloading sanic-19.12.2-py3-none-any.whl (72 kB)
|████████████████████████████████| 72 kB 5.1 MB/s
Requirement already satisfied: httptools>=0.0.10 in c:\users\<USER>\appdata\local\programs\python\python36\lib\site-packages (from sanic~=19.9->rasa=
=1.6.0) (0.1.1)
Requirement already satisfied: aiofiles>=0.3.0 in c:\users\<USER>\appdata\local\programs\python\python36\lib\site-packages (from sanic~=19.9->rasa==1
.6.0) (0.6.0)
ERROR: Exception:
Traceback (most recent call last):
File "c:\users\<USER>\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\cli\base_command.py", line 224, in _main
status = self.run(options, args)
File "c:\users\<USER>\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\cli\req_command.py", line 180, in wrapper
return func(self, options, args)
File "c:\users\<USER>\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\commands\install.py", line 321, in run
reqs, check_supported_wheels=not options.target_dir
File "c:\users\<USER>\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 122, in resol
ve
requirements, max_rounds=try_to_avoid_resolution_too_deep,
File "c:\users\<USER>\appdata\local\programs\python\python36\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 445, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "c:\users\<USER>\appdata\local\programs\python\python36\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 339, in resolve
failure_causes = self._attempt_to_pin_criterion(name, criterion)
File "c:\users\<USER>\appdata\local\programs\python\python36\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 221, in _attempt_to_pin_c
riterion
raise InconsistentCandidate(candidate, criterion)
pip._vendor.resolvelib.resolvers.InconsistentCandidate: Provided candidate LinkCandidate('https://files.pythonhosted.org/packages/90/54/17f1e496599214de
de67e37e019ce2f210b7861d2dd39b92ac4d3d08e83a/sanic-19.12.2-py3-none-any.whl#sha256=18350ed6e264631260044f6253f139f1ac83c4ce8a0202ec900ec5b50c5370ab (fro
m https://pypi.org/simple/sanic/) (requires-python:>=3.6)') does not satisfy SpecifierRequirement('sanic~=19.9'), SpecifierRequirement('sanic>=0.8.3'),
SpecifierRequirement('sanic~=19.9.0')
Apparently, the library sanic 19.12.2 is being installed and later on the proccess, there's a requirement SpecifierRequirement('sanic~=19.9'), SpecifierRequirement('sanic>=0.8.3'), SpecifierRequirement('sanic~=19.9.0') which should make sanic 19.12.2 compatible. I'm not specifying any library version anywhere, so I'm assuming this is some background requirement from Rasa.
This is the result of pip freeze:
aiofiles==0.6.0
certifi==2020.12.5
click==7.1.2
contextvars==2.4
h11==0.9.0
httpcore==0.11.1
httptools==0.1.1
httpx==0.15.4
idna==3.1
immutables==0.14
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
multidict==4.7.6
Python-dev==2.0.0.dev0
rfc3986==1.4.0
sniffio==1.2.0
websockets==5.0.1
Werkzeug==1.0.1
My Python version is 3.6.5 and pip is on version 20.3.3
Do you have any idea how I can solve this problem ?
Thanks in advance !
_____________________________________________________________________________
EDIT:
Already tried to uninstall python and pip and install them again, but it didn't solve the problem.

Since this is running on an old version of Rasa, I'd suggest doing the installation inside of the virtual environment to make sure that the dependencies you are installing are not clashing with the dependencies that are already installed on your system.
I'd still second the other suggestions of using the newer version of Rasa
(upgrading the project to 2.x) since there were lots of changes and improvements made to the library since the release of Rasa 1.6.0

Solved it. The problem was that I assumed the ~= in sanic~=19.9.0 meant that sanic version should be different from 19.9.0, when in fact it means the version should be the latest version of the package, greater than or equal to 19.9.0, but still in the 19.9.* "range" (according to this accepted answer). And this makes sanic 19.12.2 incompatible.
Tried pip install sanic~=19.9.0 before installing Rasa 1.6.0 and it solved the problem.

You're trying to install an old version of Rasa, one that currently isn't supported anymore and which therefore can have incompatible dependencies. At the time of writing Rasa is at version 2.2 and it's best to install via;
python -m pip install rasa
If you're in a virtualenv when you run this command you'll be sure that it is being installed correctly. In case you're interested there's a youtube installation guide here.

i also faced this issue and found out that you have to install sanic as below:
pip install sanic==19.9.0
The point here is that if you do pip install sanic==19.9 then it doesnt work and again gives the same error that you are facing
once you have installed the "sanic==19.9.0" then you can proceed and install
pip install rasa==1.6.0 --no-cache-dir

Related

Problem getting python to "find" the pyglet module

I am learning python via a Great Course lecture series, and in the second half of the course need to install the pyglet module. Although I have (apparently) downloaded the module successfully, my PyCharm IDE is not able to locate it, so my .py program with the instruction "import pyglet" generates the following error:
"C:\Users\the_m\PycharmProjects\Program 1\venv\Scripts\python.exe" "C:\Users\the_m\PycharmProjects\Program 1\basketball.py"
Traceback (most recent call last):
File "C:\Users\the_m\PycharmProjects\Program 1\basketball.py", line 1, in <module>
import pyglet
ModuleNotFoundError: No module named 'pyglet'
I am really enjoying the course, and enjoying getting back to coding after a multi-decade hiatus. I am working on a PC. Can anyone suggest a solution?
file locations for python and what I think are the pyglet module are as follows:
C:\Users\the_m>py -m pip --version
pip 23.0 from C:\Users\the_m\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip (python 3.11)
C:\Users\the_m>py -m pip install --upgrade pip setuptools wheel
Requirement already satisfied: pip in c:\users\the_m\appdata\local\programs\python\python311\lib\site-packages (23.0)
Requirement already satisfied: setuptools in c:\users\the_m\appdata\local\programs\python\python311\lib\site-packages (65.5.0)
Collecting setuptools
Downloading setuptools-67.2.0-py3-none-any.whl (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 607.4 kB/s eta 0:00:00
Collecting wheel
Downloading wheel-0.38.4-py3-none-any.whl (36 kB)
Installing collected packages: wheel, setuptools
WARNING: The script wheel.exe is installed in 'C:\Users\the_m\AppData\Local\Programs\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Attempting uninstall: setuptools
Found existing installation: setuptools 65.5.0
Uninstalling setuptools-65.5.0:
Successfully uninstalled setuptools-65.5.0
Successfully installed setuptools-67.2.0 wheel-0.38.4

After using pip, I get the error "Scikit-learn has not been built correctly"

I'm using a Jetson Nano and I already tried reinstalling tensorflow (tried different versions) and numpy (also different versions). I'm using the pip3 commands, since I'm using python3 (version 3.6.9).
Downgrading everything didn't work, since Keras needs tensorflow >2.2
I also tried reinstalling scikit-learn, using the --force-reinstall flag.
Since it might be helpful, here is the full error message I receive when trying to run my program:
Traceback (most recent call last):
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/__init__.py", line 44, in <module>
from ._check_build import check_build # noqa
ImportError: /home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/../../scikit_learn.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "LSTMMVMSTSF.py", line 4, in <module>
import sklearn
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__init__.py", line 81, in <module>
from . import __check_build # noqa: F401
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/__init__.py", line 46, in <module>
raise_build_error(e)
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/__init__.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: /home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/../../scikit_learn.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block
___________________________________________________________________________
Contents of /home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build:
__init__.py _check_build.cpython-36m-aarch64-linux-gnu.so__pycache__
setup.py
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
Edit: I forgot to add information on the installation of scikit-learn. I used sudo pip3 install scikit-learn. The logs of that installment:
sudo pip3 install scikit-learn Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting scikit-learn
Downloading scikit_learn-0.24.2-cp36-cp36m-manylinux2014_aarch64.whl (24.0 MB)
|████████████████████████████████| 24.0 MB 20.5 MB/s
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (2.1.0)
Requirement already satisfied: joblib>=0.11 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (1.0.1)
Requirement already satisfied: numpy>=1.13.3 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (1.19.0)
Requirement already satisfied: scipy>=0.19.1 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (1.5.4)
Installing collected packages: scikit-learn
Successfully installed scikit-learn-0.24.2
I found the answer in another post:
There is no actual issue with installing, the order of imports just needs to be changed. In my case, I had to make sklearn the first import. Further reading here
For those who cannot change import order (For example, library which uses sklearn raises error), I resolved this problem by setting environment variable LD_PRELOAD to path to libgomp-d22c30c5.so.1.0.0.
export LD_PRELOAD='/PATH/TO/libgomp-d22c30c5.so.1.0.0'
And execute program again.
You need to install the tensorflow whl specific to aarch64 architecture. The prebuilt tensorflow binaries for aarch64 are provided by nvidia at the following location
https://developer.download.nvidia.com/compute/redist/jp/v44/
This link is for jetpack 4.4 (v44). Update the link based on the jetpack version you are using.

Jnius installation bug, "Unable to determine JDK_HOME"

I tried to install jnius Python module by typing 'pip install jnius' in CMD.
This is the message I got:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\setup.py", line 111, in <module>
raise Exception('Unable to determine JDK_HOME')
Exception: Unable to determine JDK_HOME
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\
I restarted CMD, but it didn't help.
I have finally resolved it. I have installed Cython before this happened and I installed both Java JDK and JRE after #Chris comment. And I have also added JAVA_HOME and JDK_HOME to system variables.Thank you #Chris, but it didn't resolve problem completely.
Then I got another error message. There was written that I have to install Microsoft Visual C++ Compiler for Python 2.7 from this page:
https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
After that I tried to install jnius again but the error message said that permission is denied so I ran CMD as administrator and finally installed jnius by typing pip install jnius.
I spent a lot of time to resolve it and hope that it will help everyone with same or similar problem.
I have resolved the problem in windows os.
1st step:
I have installed cython by using pip install cython
C:\Users>pip install cython
Collecting cython
Downloading Cython-0.29.22-cp38-cp38-win_amd64.whl (1.7 MB)
|████████████████████████████████| 1.7 MB 1.3 MB/s
Installing collected packages: cython
Successfully installed cython-0.29.22
2nd step:
I have installed jnius by using pip install pyjnius command
C:\Users>pip install pyjnius
Collecting pyjnius
Downloading pyjnius-1.3.0-cp38-cp38-win_amd64.whl (226 kB)
|████████████████████████████████| 226 kB 3.2 MB/s
Requirement already satisfied: cython in c:\users\sss\appdata\local\programs\python\python38\lib\site-packages (from pyjnius) (0.29.22)
Requirement already satisfied: six>=1.7.0 in c:\users\sss\appdata\local\programs\python\python38\lib\site-packages (from pyjnius) (1.15.0)
Installing collected packages: pyjnius
Successfully installed pyjnius-1.3.0
I hope this solves your problem.
The thing that worked for me was simply adding JAVA_HOME and JDK_HOME variables.

Clean workaround for Pip issues under PyCharm that won't entail direct CLI access

I'd like to be able to document how to add a package to a VirtualEnv under Python 3.6 in PyCharm.
“Unable to locate finder for 'pip._vendor.distlib'” error when using "pip install virtualenv" , for one example, articulates what appears to be the same basic issue, a known issue with current PyCharm, resolved by command line commands.
I like the LUM CLI and it is like a native language to me, but I am trying to document things clearly for developers who may or may not be comfortable with any Unix-like CLI, and the instructions in the question above ask people to resolve the matter through the CLI.
Is there any way either to fix the Pip issues from within PyCharm as IDE, or to attach a project to a VirtualEnv and install a package represented on PyPI?
The error message I'm getting (for the curious) is:
Collecting bleach
Downloading bleach-2.0.0-py2.py3-none-any.whl
Collecting html5lib>=0.99999999 (from bleach)
Downloading html5lib-0.999999999-py2.py3-none-any.whl (112kB)
Collecting six (from bleach)
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting setuptools>=18.5 (from html5lib>=0.99999999->bleach)
Downloading setuptools-34.3.2-py2.py3-none-any.whl (389kB)
Collecting webencodings (from html5lib>=0.99999999->bleach)
Downloading webencodings-0.5.tar.gz
Collecting appdirs>=1.4.0 (from setuptools>=18.5->html5lib>=0.99999999->bleach)
Downloading appdirs-1.4.3-py2.py3-none-any.whl
Collecting packaging>=16.8 (from setuptools>=18.5->html5lib>=0.99999999->bleach)
Downloading packaging-16.8-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools>=18.5->html5lib>=0.99999999->bleach)
Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
Installing collected packages: six, appdirs, pyparsing, packaging, setuptools, webencodings, html5lib, bleach
Found existing installation: setuptools 18.1
Uninstalling setuptools-18.1:
Successfully uninstalled setuptools-18.1
Rolling back uninstall of setuptools
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Exception:
Traceback (most recent call last):
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\basecommand.py", line 223, in main
status = self.run(options, args)
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\commands\install.py", line 299, in run
root=options.root_path,
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\req\req_set.py", line 646, in install
**kwargs
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\req\req_install.py", line 813, in install
self.move_wheel_files(self.source_dir, root=root)
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\req\req_install.py", line 1008, in move_wheel_files
isolated=self.isolated,
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\wheel.py", line 465, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\_vendor\distlib\scripts.py", line 323, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\_vendor\distlib\scripts.py", line 227, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\_vendor\distlib\scripts.py", line 163, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\_vendor\distlib\scripts.py", line 302, in _get_launcher
result = finder(distlib_package).find(name).bytes
File "C:\Users\CJSHa\cardshopenv\lib\site-packages\pip-7.1.0-py3.6.egg\pip\_vendor\distlib\resources.py", line 297, in finder
raise DistlibException('Unable to locate finder for %r' % package)
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
From PyCharm docs, regarding pip:
PyCharm provides a dedicated tool for installing, uninstalling, and
upgrading Python packages. So doing, if a packaging tool is missing,
PyCharm suggests to install it.
And regarding virtualenv:
PyCharm makes it possible create virtual environment using the
virtualenv tool. So doing, PyCharm tightly integrates with virtualenv,
and enables configuring virtual environments right in the IDE.

PyInstaller won't install, Python 3.6.0a4 and x64 Windows

I have said Python version (from https://www.python.org/downloads/windows/), and x64 Windows 10.
Every time I try to execute "pip install pyinstaller" it crashes with an error:
C:\WINDOWS\system32>pip install pyinstaller
Collecting pyinstaller
Using cached PyInstaller-3.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\users\jskurski\appdata\local\programs\python\python36\lib\site-packages (from pyinstaller)
Collecting pefile (from pyinstaller)
Using cached pefile-2016.3.28.tar.gz
Collecting pypiwin32 (from pyinstaller)
Using cached pypiwin32-219.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\jskurski\AppData\Local\Temp\pip-build-y9lsbd5f\pypiwin32\setup.py", line 121
print "Building pywin32", pywin32_version
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\jskurski\AppData\Local\Temp\pip-build-y9lsbd5f\pypiwin32\
So, for me it seems there is a version msmatch or something. Unofortunately, I can not figure it out myself.
Any suggestions?
Has anybody sucessfully used PyInstaller with latest 3.6 Python on Windows? Or maybe I should downgrade Python to older version?
edit: tested on another PC (same enviroment) and it was the same.
edit2: seems to work on 3.5.2 version, so it's probably a way to go, for now.
pyinstaller needs pypiwin32 module.
when pip tries to install it, it shows an error because there is no pypiwin32 for python3.6
Case is closed for me, as I downgraded to stable 3.5.2. Probably some inconsistency in that alpha release, which caused this. I just wanted to write a simple GUI Windows program, so I will not investigate further.
You have to install manually pywin32 according to your version of python. The following link you can download.
https://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/
Once installed pywin32 with your right version of python. Pyinstaller must be installed
As cdarke pointed out, you are running python 2 code on Python 3.
Try this instead:
pip3 install pyinstaller

Categories

Resources