-
Notifications
You must be signed in to change notification settings - Fork 260
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
Error "No such file or directory, virtualenv" when running elpy-config #1652
Comments
I did made some recent changes on how Eply's RPC works. Elpy is now calling I made a PR to |
@kirk86 another option is to install Elpy from MELPA Stable, if you do not wish to wait for a fix. |
@kirk86 This PR was necessary to avoid having to install Elpy's python dependencies in every virtualenvs you wanted to work in (see #1546 and the PR #1548). I did as much tests as I could before merging, but there is apparently still some quirks. However, It would be nice if you could help me figure this bug out.
Elpy needs some python packages (jedi, yapf, black,...) to provide some features. |
I'm happy to help as much as I can, but I'm not an elisp expert.
Got it! What it would make sense to me is to leave explicit in the docs that elpy needs x,y,z packages to provide its functionality and allow the user to denote via a path or something the main env from where elpy should pick up those packages. For instance, I use conda and my main conda env is very minimal with only the necessary stuff. For everything else I build their own dedicated conda envs with the necessary packages. In a scenario like this it would make sense as a user to install jedi, autopep, etc. in the main conda env and tell elpy to get the prerequisite from that env. Now from inisde emacs whenever I do Think of it like the PATH variable in shell, where we point it |
Interesting, personally I've always liked that Elpy installs all of its dependencies in the activated virtual environment. It keeps stuff much tidier IMO. This is specially true for projects that have e.g. I consider that the advantage of having your IDE use the exact same dev tools that your project specifies outweighs the disadvantage of having to set them up for every new virtual env (which happens only once per project, really). Have you decided if you're going to maintain an option to keep the original behaviour? |
Don't know if its related .... but elpy stopped working for me .. and everything I do gives me this error message: elpy-rpc-get-or-create-venv: Opening output file: No such file or directory, /Users/pbeck/.virtualenvs/elpy-rpc-venv/elpy-rpc-python-path-command EDIT: Had to change to the version of elpa stable that works. I'm on MacOS 10.14.6 and Emacs 26.2 |
Ok ... I'm fixed it. I was already using an virtualenv that I activated before launching emacs so elpy would install the dependencies on it. I stopped activating it and elpy started giving the message "installing dependencies" or something like that and now i have: Elpy Configuration Emacs.............: 26.2 BUT M-. (elpy-goto-definition) stopped working! (don't know if something else) |
I don't like this behaviour at all. First of I don't like when programs clutter my home directory with Second of all, now I'm in this case where I'll have to activate some virtualenv so that elpy can install those required packages. Previously I had may default main conda environment with the prerequisite packages for elpy installed and not matter which file I was editing prerequisite packages were being picked up correctly by elpy-config. Jedi, Autopep8, etc, are not being picked up properly? I want elpy with previous behaviour before the update, where should I look and how should I get it? |
I also preferred that there was some config option to say the virtualenv to use to get/install the dependencies! ` (setq flycheck-python-pycompile-executable "~/Development/emacs_vv3/bin/python3") (setq flycheck-python-flake8-executable "~/Development/emacs_vv3/bin/python3") |
I understand your concern, PR #1658 will allow to get the old behaviour back and run the RPC in the current virtualenv (I will put some more details in the PR description).
This should be fixed by #1658 as well.
I forgot a dependency requirement when re-organizing files, it should be fixed by now.
Melpa stable will do (just tested now), if you are still seeing |
PR #1658 will allow to customize the virtualenv used by the RPC with a new option |
@galaunay looking forward to that! Thanks for the hard work on this library, I use it practically every day. |
For me when "virtualenv" is installed it is not possible to install anything in the virtual environment with pip. When first created by elpy it fails to install dependencies. In the config page I get this error when trying to install them. When the virtual environment get created with "python -m venv" by removing "virtualenv" or by creating them in the command line everything works fine. edit: seems to be a distro related problem |
@federicotdn Thanks, it's nice to know that people are enjoying Elpy :). @maggo007 I just made a commit to use |
A thought: does it make sense to warn the user that elpy is about to create a venv on its own? Not that I'm really peeved by this, and understand the justification completely (this is exactly how I have my emacs-julia setup configured as well: with a dedicated julia env/package so that I don't have to worry about dependencies leaking into other projects). But it does seem like it'd be good to prompt the user that elpy is about to try to finagle with files outside of its own directory. |
I get your point, I updated PR #1658 to ask users before the creation of any virtualenv. We could also create the venv in Elpy's directory or in a |
Hi @galaunay, Would you please add an option to |
Hi @sten0, It should work with |
PR #1658 should have addressed most of the concerns raised here:
If you want to get back the old Elpy behaviour, just set I am closing this issue, feel free to re-open if there is still to discuss on those points. |
Summary
After activating a virtual environment created with
python -m venv env
usingpyvenv-activate
, runningM-x elpy-config
no longer works, with the following messages:I have always used Elpy without
virtualenv
, without any problems. I think this commit may have changed something there.Steps to reproduce
python3 -m venv env
pyvenv-activate
M-x elpy-config
, without havingvirtualenv
installedMy configuration
macOS Mojave 10.14.6
Python 3.7.4
Result of
(elpy-config)
Not available.
Elpy configuration in my init.el
The text was updated successfully, but these errors were encountered: