Coder Social home page Coder Social logo

vf install not working about virtualfish HOT 8 CLOSED

CSJ7701 avatar CSJ7701 commented on June 11, 2024
vf install not working

from virtualfish.

Comments (8)

loudmouth avatar loudmouth commented on June 11, 2024

Lucky enough to just have gotten a fresh machine that I'm setting up and I'm experiencing the same issue, exactly as described above, except instead of the terminal hanging, vf simply isn't a command available in my path. Once i run eval (python -m virtualfish) suddenly vf is found, but then i get the warning.

using fish 3.6.1 and python 3.9.17 installed via pyenv.

from virtualfish.

justinmayer avatar justinmayer commented on June 11, 2024

I tested this without --user, in a new virtual environment, and I can't replicate this problem:

virtualenv vftest && source vftest/bin/activate.fish
python -m pip install virtualfish
mv ~/.config/fish/conf.d/virtualfish-loader.fish ~/
exec fish
vf install
exec fish
vf ls

In short, everything functions as expected when I follow the above steps. Perhaps try something similar, without --user, and see if you see anything different?

from virtualfish.

loudmouth avatar loudmouth commented on June 11, 2024

Hey Justin, thanks for the quick reply,

Removing the --user flag didn't improve anything for me. I had 2 questions based on what you posted above:

  1. is installing virtualenv first a requirement? While that logically would make sense, it's not listed in the docs, so I thought virtualfish would install its own dependencies.
  2. Is the virtualfish-loader a requirement to get things working properly? I have the loader on my old machine, but porting it over had caused some issues as the script had a hardcoded version of python in it. I didn't see anything in the docs about it, so I elected to just delete it while setting things up.

from virtualfish.

justinmayer avatar justinmayer commented on June 11, 2024

from virtualfish.

loudmouth avatar loudmouth commented on June 11, 2024

got it. knowing that the script is added during installation helped. I had actually copied my fish config folder over from a previous machine so it probably explains it. I uninstalled and reinstalled virtualfish via pip and on reinstallation, i got a warning:

  WARNING: The script vf is installed in '/Users/MY_USER/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

after adding /Users/MY_USER/.local/bin to my path, vf was available and i was able to run vf install.

Though my issue sounds similar to the original author's post, I wonder if there is some idiosyncracy in the personal migration route I took from old machine to new 🀷 anyway, it's working for me now. I appreciate your efforts in troubleshooting.

from virtualfish.

justinmayer avatar justinmayer commented on June 11, 2024

Inside ~/.config/fish/conf.d/virtualfish-loader.fish, VirtualFish stores the path to the Python interpreter used when VirtualFish was installed inside the VIRTUALFISH_PYTHON_EXEC variable:

set -g VIRTUALFISH_VERSION 2.5.5
set -g VIRTUALFISH_PYTHON_EXEC /some/path/to/bin/python
source /Users/jm/Projects/virtualfish/virtualfish/virtual.fish
source /Users/jm/Projects/virtualfish/virtualfish/compat_aliases.fish
source /Users/jm/Projects/virtualfish/virtualfish/projects.fish
source /Users/jm/Projects/virtualfish/virtualfish/environment.fish
emit virtualfish_did_setup_plugins

As such, I imagine you will indeed experience problems if you copy that file to a new machine where that path does not point to a Python interpreter.

The vf install step creates the ~/.config/fish/conf.d/virtualfish-loader.fish file, with the contents being the lines shown above.

@CSJ7701: Instead of running vf install, what happens if you manually create ~/.config/fish/conf.d/virtualfish-loader.fish with the above contents (adjusting the VIRTUALFISH_PYTHON_EXEC value appropriately) and then run exec fish? Does vf then behave as you would expect?

from virtualfish.

CSJ7701 avatar CSJ7701 commented on June 11, 2024

I think I have managed to solve my issue.
Instead of installing using pip, I installed virtualfish using my system's package manager. I then faced another issue, where I got an "invalid version" error from packaging.version.parse(). This seperate issue was mentioned in #238 and I fixed it by changing cmd = ["fish", "-c", "echo $version"] in virtualfish/loader/cli.py to cmd = ["fish", "-N", "-c", "echo $version"].

from virtualfish.

justinmayer avatar justinmayer commented on June 11, 2024

Thank you, Christian, for taking a moment to report your findings and close this issue. Regarding the separate issue you mentioned, the just-released VirtualFish 2.5.6 should address it. 😁

from virtualfish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.