jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 261 forks source link

Elpy elpy-shell-send-region-or-buffer does not see packages in my virutal enviroment #1644

Open DurhamSmith opened 5 years ago

DurhamSmith commented 5 years ago

I when I try to C-c C-c I get the following

ModuleNotFoundError: No module named 'pybel'

I am using my virtual environment (activated with pyven-workon).

If I open a shell and activate the same virtual environment I am able to run the script fine (no ModuleNotFoundError).

System details: Ubuntu 18.04 Emacs 26.2 Elpy 1.30.0

My elpy-config reports

Virtualenv........: ligand_finder (/home/dd/.virtualenvs/ligand_finder) RPC Python........: 3.7.3 (/home/dd/.virtualenvs/ligand_finder/bin/python) Interactive Python: python (/home/dd/.virtualenvs/ligand_finder/bin/python) Emacs.............: 26.2 Elpy..............: 1.30.0 Jedi..............: 0.15.1 Rope..............: Not found (0.14.0 available) Autopep8..........: Not found (1.4.4 available) Yapf..............: Not found (0.28.0 available) Black.............: 19.3b0 Syntax checker....: flake8 (/home/dd/.virtualenvs/ligand_finder/bin/flake8)

galaunay commented 5 years ago

Could you post the value of sys.path from the python interpreter ?

Also, if you started the python interpreter before activating the virtualenv, you may need to restart the interpreter.