virtualfish icon indicating copy to clipboard operation
virtualfish copied to clipboard

bin folder isn't added to path correctly for Python3.10 (local/bin/ isn't used)

Open jjnesbitt opened this issue 3 years ago • 2 comments

  • [x] I am using Fish shell version 3.1 or higher.
  • [x] I am using Python version 3.6 or higher.
  • [x] I have searched the issues (including closed ones) and believe that this is not a duplicate.
  • [x] If related to a plugin, I prefixed the issue title with the name of the plugin.
  • OS version and name: Ubuntu 20.04.5 LTS
  • Fish shell version: 3.5.1
  • VirtualFish version: 2.5.3

Issue

When creating a venv with python3.10 (in my case 3.10.7), the bin folder is located under <venv>/local/bin/, not simply <venv>/bin. I've looked at the virtualfish source code a bit and it seems this is never explicitly handled, it's just assumed that bin. This is also evidenced by the fact that echoing $PATH shows bin instead of local/bin. And yes, python3.10 is in my path.

To reproduce:

  • Install virtualfish
  • Install python3.10

image

jjnesbitt avatar Sep 16 '22 21:09 jjnesbitt

Hi Jacob. I have never seen this behavior. Some questions:

  1. How did you install Python 3.10?

  2. Is that the only Python interpreter on your system? If not, provide details about others.

  3. How exactly did you install VirtualFish?

  4. What version of Virtualenv do you have installed?

  5. If you use Virtualenv to manually create a new virtual environment, do you also see […]/local/bin instead of […]/bin?

justinmayer avatar Sep 17 '22 08:09 justinmayer

  1. I installed Python 3.10 through APT
  2. I also have 3.8.10 and 3.9.14 installed, both also through APT.
  3. I installed virtualfish through pip as the docs specify, using python3.8 (my system default).
  4. My virtualfish version is 20.8.1
  5. Indeed I do.

I'd also like to note that I followed these steps, and it appears to have fixed my issue (there is now a bin folder at the venv root level). However the local/bin folder still exists (and contains what it did before), so I think it's still fair to check that.

jjnesbitt avatar Sep 19 '22 16:09 jjnesbitt

I am also having this issue Ubuntu 22.04

  1. Python 3.10.4 installed via apt
  2. Yes
  3. Installed via pip, using the docs
$ virtualenv --version
virtualenv 20.16.5 from /home/myhomedirectory/.local/lib/python3.10/site-packages/virtualenv/__init__.py
  1. Yes
$ vf --help
VirtualFish 2.5.5
...

I am also having the same issue after installing it on pop-os 22.04 with python3.10

bhargavkakadiya avatar Feb 07 '23 06:02 bhargavkakadiya

I was able to resolve as well with this https://github.com/justinmayer/virtualfish/issues/232#issuecomment-1251261914 Thank you @AlmightyYakob

bhargavkakadiya avatar Feb 07 '23 06:02 bhargavkakadiya

As seen above, I have posted a comment asking Bernát, maintainer of Virtualenv, if he knows why this situation occurs. I have examined several ways of handling this, and all of them are messier than I would like — particularly when it is not clear why this seemingly-odd state happens in the first place.

Assuming we are able to collect more information regarding why this occurs, then perhaps it will make sense to consider handling this state within VirtualFish.

justinmayer avatar Feb 07 '23 08:02 justinmayer

According to the maintainer of Virtualenv, this situation could be caused by an old/corrupted cache folder and isn't something that should happen under normal circumstances. Ergo, I don't think it makes much sense to handle this odd state-of-affairs explicitly in VirtualFish.

justinmayer avatar Feb 07 '23 15:02 justinmayer