syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

Anaconda code navigation does not work. #9777

Closed biocyberman closed 4 years ago

biocyberman commented 6 years ago

Description :octocat:

Code navitation does not work in anaconda-mode

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

Expected behaviour: :heart: :smile:

Cursor should jump to the definition of the function or variable in the following cases:

System Info :computer:

CeleritasCelery commented 6 years ago

Since anaconda-mode-find-definition doesn't work, you should report this upstream at anaconda-mode. also SPC m g g is bound correctly.

syl20bnr commented 6 years ago

@biocyberman the upstream ticket is closed, are you ok now ?

biocyberman commented 6 years ago

@syl20bnr Thanks for giving me a heads up. I still can't get the thing to work. I am testing a temporary clean setup with only python layer enabled.

syl20bnr commented 6 years ago

What's the content of the *anaconda* buffer? (buffer may be named slightly differently)

biocyberman commented 6 years ago

@syl20bnr I have *anaconda-mode* buffer, and it is empty.

Following are my observation with verbatim installation of spacemacs:

1. Reproduction guide (yes you need a guide for reproduction, you should laugh).

2. Observed behaviour:

Installed /home/user/.emacs.d/.cache/anaconda-mode/0.1.9/anaconda_mode-0.1.9-py2.7.egg Processing dependencies for anaconda_mode==0.1.9 Searching for service_factory>=0.1.5 Skipping development or system egg: service-factory 0.1.2 Reading https://pypi.python.org/simple/service_factory/ Downloading https://pypi.python.org/packages/d1/32/bacd539bc748af613082f8cf80c82311373a05bb4af2d43bc2ff5bbdcdcc/service_factory-0.1.5.tar.gz#md5=a0dd7745280da2284e8bdc2c03b853e4 Best match: service-factory 0.1.5 Processing service_factory-0.1.5.tar.gz Writing /tmp/easy_install-vYiifc/service_factory-0.1.5/setup.cfg Running service_factory-0.1.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-vYiifc/service_factory-0.1.5/egg-dist-tmp-40M_gx creating /home/user/.emacs.d/.cache/anaconda-mode/0.1.9/service_factory-0.1.5-py2.7.egg Extracting service_factory-0.1.5-py2.7.egg to /home/user/.emacs.d/.cache/anaconda-mode/0.1.9 Adding service-factory 0.1.5 to easy-install.pth file

Installed /home/user/.emacs.d/.cache/anaconda-mode/0.1.9/service_factory-0.1.5-py2.7.egg Processing dependencies for service_factory>=0.1.5 Finished processing dependencies for service_factory>=0.1.5 Searching for jedi>=0.11 Skipping development or system egg: jedi 0.8.1 Reading https://pypi.python.org/simple/jedi/ Downloading https://pypi.python.org/packages/08/8d/34b133dfa210b55e7efaa8b09c736a8f4383fcda0b6487fc43a1db3c7ee7/jedi-0.11.0.tar.gz#md5=a948c0903b03bf361c60742947f076a0 Best match: jedi 0.11.0 Processing jedi-0.11.0.tar.gz Writing /tmp/easy_install-IKUxZD/jedi-0.11.0/setup.cfg Running jedi-0.11.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-IKUxZD/jedi-0.11.0/egg-dist-tmp-co40I2 warning: no files found matching 'jedi/parser/python/grammar.txt' warning: no previously-included files matching '.pyc' found under directory '*' zip_safe flag not set; analyzing archive contents... jedi.main: module references file jedi.evaluate.pep0484: module references file jedi.evaluate.representation: module references file jedi.evaluate.sys_path: module references file jedi.evaluate.compiled.init: module references file jedi.evaluate.compiled.fake: module references file jedi.evaluate.compiled.mixed: module MAY be using inspect.getsourcefile creating /home/user/.emacs.d/.cache/anaconda-mode/0.1.9/jedi-0.11.0-py2.7.egg Extracting jedi-0.11.0-py2.7.egg to /home/user/.emacs.d/.cache/anaconda-mode/0.1.9 Adding jedi 0.11.0 to easy-install.pth file

Installed /home/user/.emacs.d/.cache/anaconda-mode/0.1.9/jedi-0.11.0-py2.7.egg Processing dependencies for jedi>=0.11 Searching for parso==0.1.0 Reading https://pypi.python.org/simple/parso/ Downloading https://pypi.python.org/packages/32/f4/9f1ee3fc5f7a23aee6454feeadef423ef1aed405208135e81620b4e3ba77/parso-0.1.0.tar.gz#md5=b1713a03af5935d96dfde1e853ccda5a Best match: parso 0.1.0 Processing parso-0.1.0.tar.gz Writing /tmp/easy_install-BxGCFL/parso-0.1.0/setup.cfg Running parso-0.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-BxGCFL/parso-0.1.0/egg-dist-tmp-S_JLy5 warning: no previously-included files matching '.pyc' found under directory '' zip_safe flag not set; analyzing archive contents... parso.grammar: module references file creating /home/user/.emacs.d/.cache/anaconda-mode/0.1.9/parso-0.1.0-py2.7.egg Extracting parso-0.1.0-py2.7.egg to /home/user/.emacs.d/.cache/anaconda-mode/0.1.9 Adding parso 0.1.0 to easy-install.pth file

Installed /home/user/.emacs.d/.cache/anaconda-mode/0.1.9/parso-0.1.0-py2.7.egg Processing dependencies for parso==0.1.0 Finished processing dependencies for parso==0.1.0 Finished processing dependencies for jedi>=0.11 Finished processing dependencies for anaconda_mode==0.1.9


- However, on the next attempt, `*anaconda-mode*` buffer is empty.
biocyberman commented 6 years ago

I also tried anaconda mode without spacemacs, and it works. Therefore, I think there is something not working with anaconda-mode in spacemacs.

When anaconda-mode is working on non-spacemacs setup, there is a line at the end of *anaconda-mode* buffer: "anaconda_mode port 45143"

 Searching for anaconda_mode==0.1.9
Reading https://pypi.python.org/simple/anaconda_mode/
Downloading https://pypi.python.org/packages/a6/f5/a8d433eb628e1584a5f5425a72770cc56d09d99dbc384e08178457cd5d23/anaconda_mode-0.1.9.tar.gz#md5=94c2cd0b72834bd1b1a5a6904dbc774a
Best match: anaconda-mode 0.1.9
Processing anaconda_mode-0.1.9.tar.gz
Writing /tmp/easy_install-hCos5i/anaconda_mode-0.1.9/setup.cfg
Running anaconda_mode-0.1.9/setup.py -q bdist_egg --dist-dir /tmp/easy_install-hCos5i/anaconda_mode-0.1.9/egg-dist-tmp-fe5won
no previously-included directories found matching 'test'
creating /tmp/emacs/.emacs.d/anaconda-mode/0.1.9/anaconda_mode-0.1.9-py2.7.egg
Extracting anaconda_mode-0.1.9-py2.7.egg to /tmp/emacs/.emacs.d/anaconda-mode/0.1.9
Adding anaconda-mode 0.1.9 to easy-install.pth file

Installed /tmp/emacs/.emacs.d/anaconda-mode/0.1.9/anaconda_mode-0.1.9-py2.7.egg
Processing dependencies for anaconda_mode==0.1.9
Searching for service_factory>=0.1.5
Reading https://pypi.python.org/simple/service_factory/
Downloading https://pypi.python.org/packages/d1/32/bacd539bc748af613082f8cf80c82311373a05bb4af2d43bc2ff5bbdcdcc/service_factory-0.1.5.tar.gz#md5=a0dd7745280da2284e8bdc2c03b853e4
Best match: service-factory 0.1.5
Processing service_factory-0.1.5.tar.gz
Writing /tmp/easy_install-C4oStd/service_factory-0.1.5/setup.cfg
Running service_factory-0.1.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-C4oStd/service_factory-0.1.5/egg-dist-tmp-yCR2AQ
creating /tmp/emacs/.emacs.d/anaconda-mode/0.1.9/service_factory-0.1.5-py2.7.egg
Extracting service_factory-0.1.5-py2.7.egg to /tmp/emacs/.emacs.d/anaconda-mode/0.1.9
Adding service-factory 0.1.5 to easy-install.pth file

Installed /tmp/emacs/.emacs.d/anaconda-mode/0.1.9/service_factory-0.1.5-py2.7.egg
Processing dependencies for service_factory>=0.1.5
Finished processing dependencies for service_factory>=0.1.5
Searching for jedi>=0.11
Reading https://pypi.python.org/simple/jedi/
Downloading https://pypi.python.org/packages/08/8d/34b133dfa210b55e7efaa8b09c736a8f4383fcda0b6487fc43a1db3c7ee7/jedi-0.11.0.tar.gz#md5=a948c0903b03bf361c60742947f076a0
Best match: jedi 0.11.0
Processing jedi-0.11.0.tar.gz
Writing /tmp/easy_install-sFWLl_/jedi-0.11.0/setup.cfg
Running jedi-0.11.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-sFWLl_/jedi-0.11.0/egg-dist-tmp-0TGjdr
warning: no files found matching 'jedi/parser/python/grammar*.txt'
warning: no previously-included files matching '*.pyc' found under directory '*'
zip_safe flag not set; analyzing archive contents...
jedi.__main__: module references __file__
jedi.evaluate.pep0484: module references __file__
jedi.evaluate.representation: module references __file__
jedi.evaluate.sys_path: module references __file__
jedi.evaluate.compiled.__init__: module references __file__
jedi.evaluate.compiled.fake: module references __file__
jedi.evaluate.compiled.mixed: module MAY be using inspect.getsourcefile
creating /tmp/emacs/.emacs.d/anaconda-mode/0.1.9/jedi-0.11.0-py2.7.egg
Extracting jedi-0.11.0-py2.7.egg to /tmp/emacs/.emacs.d/anaconda-mode/0.1.9
Adding jedi 0.11.0 to easy-install.pth file

Installed /tmp/emacs/.emacs.d/anaconda-mode/0.1.9/jedi-0.11.0-py2.7.egg
Processing dependencies for jedi>=0.11
Searching for parso==0.1.0
Reading https://pypi.python.org/simple/parso/
Downloading https://pypi.python.org/packages/32/f4/9f1ee3fc5f7a23aee6454feeadef423ef1aed405208135e81620b4e3ba77/parso-0.1.0.tar.gz#md5=b1713a03af5935d96dfde1e853ccda5a
Best match: parso 0.1.0
Processing parso-0.1.0.tar.gz
Writing /tmp/easy_install-eOTgCz/parso-0.1.0/setup.cfg
Running parso-0.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-eOTgCz/parso-0.1.0/egg-dist-tmp-KaL4Z0
warning: no previously-included files matching '*.pyc' found under directory '*'
zip_safe flag not set; analyzing archive contents...
parso.grammar: module references __file__
creating /tmp/emacs/.emacs.d/anaconda-mode/0.1.9/parso-0.1.0-py2.7.egg
Extracting parso-0.1.0-py2.7.egg to /tmp/emacs/.emacs.d/anaconda-mode/0.1.9
Adding parso 0.1.0 to easy-install.pth file

Installed /tmp/emacs/.emacs.d/anaconda-mode/0.1.9/parso-0.1.0-py2.7.egg
Processing dependencies for parso==0.1.0
Finished processing dependencies for parso==0.1.0
Finished processing dependencies for jedi>=0.11
Finished processing dependencies for anaconda_mode==0.1
anaconda_mode port 45143                                                                                                                                                                                                                                                                                           
oliveratutexas commented 6 years ago

Any update on this?

biocyberman commented 5 years ago

It may be there is nothing wrong with the layer, except that it is not well documented: I now can use "go to definition" without a problem. The secret? I have to activate a virtual python environment first:

# In the shell:
cd </path/to/myrepo>
python -m venv env
source ./env/bin/activate
#install all dependecies for development

After open the python script I want to edit, hit SPC m V a and navigate to the env directory, and ENTER. Now g d at point should work.

Emacs version: 26 Spacemacs version: 0.200.13

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!