pythonic-emacs / anaconda-mode

Code navigation, documentation lookup and completion for Python.
GNU General Public License v3.0
707 stars 87 forks source link

Error using python3.8 and also service factory uses python2.7 #385

Open hyunlee1o opened 4 years ago

hyunlee1o commented 4 years ago
Traceback (most recent call last):
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py2.7.egg/service_factory/service.py", line 101, in apply
    result = method(**params)
  File "<string>", line 99, in wrapper
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/jedi-0.13.1-py2.7.egg/jedi/api/__init__.py", line 95, in __init__
    self._grammar = parso.load_grammar()
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/parso-0.3.1-py2.7.egg/parso/grammar.py", line 250, in load_grammar
    return load_grammar(**kwargs)
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/parso-0.3.1-py2.7.egg/parso/grammar.py", line 246, in load_grammar
    raise NotImplementedError(message)
NotImplementedError: Python version None is currently not supported.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py2.7.egg/service_factory/providers/basehttp.py", line 40, in do_POST
    status, response = self.server.service(data)
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py2.7.egg/service_factory/service.py", line 50, in __call__
    result = self.apply(method, args)
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py2.7.egg/service_factory/service.py", line 105, in apply
    server_error(args['id'], error)
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py2.7.egg/service_factory/errors.py", line 91, in server_error
    raise ServiceException(500, dumps(response))
service_factory.exceptions.ServiceException: (500, '{"jsonrpc": "2.0", "id": 1, "error": {"code": -32000, "message": "Server error", "data": "NotImplementedError(\'Python version None is currently not supported.\')"}}')
dakra commented 4 years ago

Is this still an issue? I'm running anaconda (and service_factory) with python 3.8 myself fine.

gdevanla commented 4 years ago

I see the same error. Any tips on resolving this would be much appreciated. I am on emacs-26.3

anaconda_mode port 42597                                                                                                                                                                                            
127.0.0.1 - - [19/Aug/2020 11:08:25] ================================================================================                                                                                               
Traceback (most recent call last):                                                                                                                                                                                  
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/parso-0.3.1-py3.5.egg/parso/grammar.py", line 236, in load_grammar                                                                                                 
    return _loaded_grammars[path]                                                                                                                                                                                   
KeyError: '/home/user/.emacs.d/anaconda-mode/0.1.13/parso-0.3.1-py3.5.egg/parso/python/grammar38.txt'                                                                                                               

During handling of the above exception, another exception occurred:                                                                                                                                                 

Traceback (most recent call last):                                                                                                                                                                                  
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/parso-0.3.1-py3.5.egg/parso/grammar.py", line 239, in load_grammar                                                                                                 
    with open(path) as f:                                                                                                                                                                                           
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.emacs.d/anaconda-mode/0.1.13/parso-0.3.1-py3.5.egg/parso/python/grammar38.txt'                                                                 

During handling of the above exception, another exception occurred:                                                                                                                                                 

Traceback (most recent call last):                                                                                                                                                                                  
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py3.5.egg/service_factory/service.py", line 101, in apply                                                                                    
    result = method(**params)                                                                                                                                                                                       
  File "<string>", line 99, in wrapper                                                                                                                                                                              
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/jedi-0.13.2-py3.5.egg/jedi/api/__init__.py", line 95, in __init__                                                                                                  
    self._grammar = parso.load_grammar()                                                                                                                                                                            
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/parso-0.3.1-py3.5.egg/parso/grammar.py", line 250, in load_grammar                                                                                                 
    return load_grammar(**kwargs)                                                                                                                                                                                   
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/parso-0.3.1-py3.5.egg/parso/grammar.py", line 246, in load_grammar                                                                                                 
    raise NotImplementedError(message)                                                                                                                                                                              
NotImplementedError: Python version None is currently not supported.                                                                                                                                                

During handling of the above exception, another exception occurred:                                                                                                                                                 

Traceback (most recent call last):                                                                                                                                                                                  
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py3.5.egg/service_factory/providers/basehttp.py", line 40, in do_POST                                                                        
    status, response = self.server.service(data)                                                                                                                                                                    
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py3.5.egg/service_factory/service.py", line 50, in __call__                                                                                  
    result = self.apply(method, args)                                                                                                                                                                               
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py3.5.egg/service_factory/service.py", line 105, in apply                                                                                    
    server_error(args['id'], error)                                                                                                                                                                                 
  File "/home/user/.emacs.d/anaconda-mode/0.1.13/service_factory-0.1.5-py3.5.egg/service_factory/errors.py", line 91, in server_error                                                                               
    raise ServiceException(500, dumps(response))                                                                                                                                                                    
service_factory.exceptions.ServiceException: (500, '{"jsonrpc": "2.0", "id": 1, "error": {"code": -32000, "message": "Server error", "data": "NotImplementedError(\'Python version None is currently not supported.\
\')"}}')                                                                                                                                                                                                            
gdevanla commented 4 years ago

Wanted to leave a note on how I resolved this issue: I removed anaconda installation from ~/.emacs.d. (Not sure why this folder was retained inspite of me deleting the package from Emacs.)

After deleting the package and removing the folder, I start Emacs with python env set to Python 3.8. That way, when anaconda runs the installation it is able to install packages for 3.8. Now, I am not sure if this approach breaks compatibility with projects that need Python 3.7.

ryukinix commented 4 years ago

Thank you for sharing your solution @gdevanla, I did the same thing here and worked.