justinmayer / virtualfish

Fish shell tool for managing Python virtual environments
MIT License
1.07k stars 101 forks source link

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

Closed jjnesbitt closed 1 year ago

jjnesbitt commented 2 years ago

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:

image

justinmayer commented 2 years ago

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?

jjnesbitt commented 2 years ago
  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.

simon-brantonhousley-caribou commented 2 years ago

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
  4. $ virtualenv --version
    virtualenv 20.16.5 from /home/myhomedirectory/.local/lib/python3.10/site-packages/virtualenv/__init__.py
  5. Yes
$ vf --help
VirtualFish 2.5.5
...
bhargavkakadiya commented 1 year ago

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

bhargavkakadiya commented 1 year ago

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

justinmayer commented 1 year ago

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 commented 1 year ago

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.