pyvenv
pyvenv copied to clipboard
workon not finding python executable
Not quite sure how to explain this... pyvenv seem to search for python without finding it (??) here's a couple of things I've tried:
-
M-x pyvenv-workon RET boto RET
produces the following on the Messages buffer:apply: Searching for program: No such file or directory, python
- sending/running commands results in
elpy-shell-get-or-create-process: Interpreter binaries not found in the current virtual environnement
- the command
run-python
does however run the correct python interpreter
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> python.el: native completion setup loaded
>>> import sys
>>> sys.executable
'/home/user/.virtualenvs/boto/bin/python'
>>>
I know this is a very sparse bit of info... please do let me know of more info I can provide!
same error seems to happen when creating an env with virtualenv (not virtualenvwrapper) and use pyvenv-activate
Hello, and thanks for the report! What's the output of M-x elpy-config
? Could you also do M-x toggle-debug-on-error
and do pyvenv-activate
? That should produce a backtrace with more information.
M-x elpy-config
produces the same error (start emacs, open a new tmp.py
file, M-x elpy-mode
and finally M-x elpy-config
)
as for the debug info:
Debugger entered--Lisp error: (file-error "Searching for program" "No such file or directory" "python")
call-process("python" nil t nil "-m" "virtualenvwrapper.hook_loader" "--script" "/tmp/pyvenv-virtualenvwrapper-2169om8" "pre_activate" "/home/user/.virtualenvs/a3dsurf/")
apply(call-process "python" nil t nil "-m" "virtualenvwrapper.hook_loader" "--script" "/tmp/pyvenv-virtualenvwrapper-2169om8" ("pre_activate" "/home/user/.virtualenvs/a3dsurf/")
pyvenv-run-virtualenvwrapper-hook("pre_activate" "/home/user/.virtualenvs/a3dsurf/")
pyvenv-activate("/home/user/.virtualenvs/a3dsurf")
pyvenv-workon("a3dsurf")
funcall-interactively(pyvenv-workon "a3dsurf")
call-interactively(pyvenv-workon record nil)
command-execute(pyvenv-workon record)
execute-extended-command(nil "pyvenv-workon" "pyvenv-wo")
funcall-interactively(execute-extended-command nil "pyvenv-workon" "pyvenv-wo")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
I hope this helps!
by the way,
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
by the way, outside of my virtualenv there's no python
executable in the path (it's only python3)
$ python
Command 'python' not found, but can be installed with:
sudo apt install python3
sudo apt install python
sudo apt install python-minimal
You also have python3 installed, you can run 'python3' instead.
$ which python3
/usr/bin/python3
turns out, if I create a python link to the python3 interpreter, things work out fine (workon and elpy-config
both seem to work fine)......
hope this helps!
Does (setq pyvenv-virtualenvwrapper-python "python3")
fix the problem for you?
Works for me.
So this is not really a bug, in the customize buffer it clearly says, that the "educated guess" python
can be off...