Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install rasa on macOS Catalina 10.15.4 #5775

Closed
ganeshviyer opened this issue May 4, 2020 · 7 comments
Closed

Unable to install rasa on macOS Catalina 10.15.4 #5775

ganeshviyer opened this issue May 4, 2020 · 7 comments

Comments

@ganeshviyer
Copy link

Posted the issue on Rasa forums here - https://forum.rasa.com/t/unable-to-install-rasa-on-a-fresh-installation-of-catalina/28367.

I had a fresh installation of Catalina (10.15.4) and have been struggling to install Rasa on it.

I get the following error upon doing the recommended pip3 install rasa:

Installing collected packages: setuptools, wheel
  Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.7'
  Consider using the `--user` option or check the permissions.

  You are using pip version 19.0.3, however version 20.1 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.

I have the following responses from the version commands on pip and pip3 (I have latest versions of both):

pip 20.1 from /Library/Python/2.7/site-packages/pip-20.1-py2.7.egg/pip (python 2.7)

and for pip3

pip 19.0.3 from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)

How do I resolve this and get rasa working locally?

@vishnupriyavr
Copy link
Contributor

Hi @ganeshviyer , You are trying to install the package to a system folder which you don't have permissions to write to.
You can use the option below:

  • Setup a virtual env to install the package (recommended):
python3 -m venv env
source ./env/bin/activate 
python -m pip install <package>

Please try that and let me know if it works.

@ganeshviyer
Copy link
Author

Hello @vishnupriyavr - thanks for suggesting using virtualenv. I seem to have cleared my initial hurdle, but looks like I ran into a new one.

After running the following -

python3 -m venv env
source ./env/bin/activate
python3 -m pip install rasa

the installation started and didn't end with an error (I got a warning on the pip version - I get the same warning if I use the third command I wrote above or the one you suggested). However, upon examining if rasa was correctly installed, I get a dictionary error.

(env) <path> % rasa --version

Output:

Traceback (most recent call last):
  File "/Users/ganesh/env/bin/rasa", line 10, in <module>
    sys.exit(main())
  File "/Users/ganesh/env/lib/python3.7/site-packages/rasa/__main__.py", line 82, in main
    set_log_level(log_level)
  File "/Users/ganesh/env/lib/python3.7/site-packages/rasa/utils/common.py", line 71, in set_log_level
    update_tensorflow_log_level()
  File "/Users/ganesh/env/lib/python3.7/site-packages/rasa/utils/common.py", line 112, in update_tensorflow_log_level
    import tensorflow as tf
  File "/Users/ganesh/env/lib/python3.7/site-packages/tensorflow/__init__.py", line 101, in <module>
    from tensorflow_core import *
  File "/Users/ganesh/env/lib/python3.7/site-packages/tensorflow_core/__init__.py", line 40, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 959, in _find_and_load_unlocked
  File "/Users/ganesh/env/lib/python3.7/site-packages/tensorflow/__init__.py", line 50, in __getattr__
    module = self._load()
  File "/Users/ganesh/env/lib/python3.7/site-packages/tensorflow/__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/ganesh/env/lib/python3.7/site-packages/tensorflow_core/python/__init__.py", line 64, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/Users/ganesh/env/lib/python3.7/site-packages/tensorflow_core/core/framework/graph_pb2.py", line 7, in <module>
    from google.protobuf import descriptor as _descriptor
  File "/Users/ganesh/env/lib/python3.7/site-packages/google/protobuf/__init__.py", line 37, in <module>
    __import__('pkg_resources').declare_namespace(__name__)
  File "/Users/ganesh/env/lib/python3.7/site-packages/pkg_resources/__init__.py", line 84, in <module>
    __import__('pkg_resources.extern.packaging.requirements')
  File "/Users/ganesh/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 9, in <module>
    from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/Users/ganesh/env/lib/python3.7/site-packages/pkg_resources/extern/__init__.py", line 43, in load_module
    __import__(extant)
  File "/Users/ganesh/env/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 4756, in <module>
    _escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1])
  File "/Users/ganesh/env/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1284, in setParseAction
    self.parseAction = list(map(_trim_arity, list(fns)))
  File "/Users/ganesh/env/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1066, in _trim_arity
    this_line = extract_stack(limit=2)[-1]
  File "/Users/ganesh/env/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1050, in extract_stack
    frame_summary = traceback.extract_stack(limit=-offset+limit-1)[offset]
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 211, in extract_stack
    stack = StackSummary.extract(walk_stack(f), limit=limit)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 363, in extract
    f.line
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 285, in line
    self._line = linecache.getline(self.filename, self.lineno).strip()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py", line 16, in getline
    lines = getlines(filename, module_globals)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py", line 48, in getlines
    for mod in sys.modules.values():
RuntimeError: dictionary changed size during iteration

Here's the pip warning, in case this helps.

You are using pip version 19.0.3, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

@sara-tagger
Copy link
Collaborator

Thanks for the issue, @tabergma will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

@ganeshviyer
Copy link
Author

@sara-tagger , @tabergma - Spent some time troubleshooting this. I think I may have a solution, but not sure it's the best one.

This seems exclusive to Catalina. In linecache.py in your Python folder, you need to replace sys.modules.values() in line 48 with sys.modules.copy().

This allowed me to run rasa locally and get unblocked. Not sure if this is a foolproof solution.

@tabergma
Copy link
Contributor

@ganeshviyer Glad that you found a solution! I'll close this issue as we don't need to change anything on our side for this. Feel free to open a thread on the forum to discuss your solution with others. Thanks!

@ganeshviyer
Copy link
Author

Done - https://forum.rasa.com/t/in-case-youre-having-trouble-installing-rasa-on-catalina/28702

@Govindaraju777
Copy link

Thanks you.
I was facing issue in "rasa x" in my mac os bigsur.

Always was getting same error ever after installation:
MissingDependencyException: Rasa X does not seem to be installed, but it is needed for this CLI command. You can find more information on how to install Rasa X in local mode in the documentation: https://rasa.com/docs/rasa-x/installation-and-setup/install/local-mode

Below commands solved :

python3 -m venv env
source ./env/bin/activate
python3 -m pip install rasa

pip install rasa-x --extra-index-url https://pypi.rasa.com/simple

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants