question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Virtualenv on macOS not working (fish)

See original GitHub issue

Please provide information about your setup

  • DVC version: 0.20.1
  • Platform: macOS
  • method of installation: pip

It looks like the commands run by dvc are ignoring currently used virtualenv screenshot 2018-11-08 at 13 48 32

Steps to reproduce the issue:

$ mkdir dvc_test && cd dvc_test
$ git init
$ virtualenv -p python3.6 .env
$ source .env/bin/activate
$ pip install dvc
$ dvc init
$ which python
$ dvc run which python

The output of two last commands is different, which means, that python… comannd run by DVC is not taking into acount activated virtualenv. I’ve tested with virtualenv as well as with python venv.

I’ve done the same steps on linux - it works fine, so it’s seems that the issue apears only on macOS

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:30 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, May 31, 2020

@hanan-vian Do any of the workarounds described above work for you?

Should I give up fish just so I can use dvc?

Not at all, you just need to configure your setup to make it work.

By the way, if I run dvc run in a bash it will not help as my default is still fish.

That’s because your SHELL env var keeps pointing to fish. You could set it to bash or something else and it should work fine.

I guess, dvc config should include a shell settings or a conda env setting so that one can run in fish

Sounds too hackish. The proper solution is probably to make fish support an option (e.g. --norc) that will make it usable, but fish folks seem to be against it fish-shell/fish-shell#5394 . Please feel free to comment on that issue, maybe the pressure from actual users will make them reconsider it.

As I’ve mentioned previously, we could consider launching bash (or something else if available) if we detect fish, but again that is pretty hacky and might result in some unexpected behavior. It would be great if someone who uses fish could give that approach a try and see if that works for him or not. We would be glad to accept such a patch.

See my conda run hack.

2reactions
ghostcommented, May 31, 2020

I don’t think we should close this issue, as a warning message is not a solution. Should I give up fish just so I can use dvc? By the way, if I run dvc run in a bash it will not help as my default is still fish. I guess, dvc config should include a shell settings or a conda env setting so that one can run in fish

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a virtualenv with fish shell on Mac OS? - Stack Overflow
I get this error fish: Unknown command virtualenv. Can somebody please show me how can I create virtualenv successfully.
Read more >
Fish Shell - Virtualenv path not prepended to PATH - Super User
I have this problem where when I activate a python virtual env, via >pipenv shell , the virtual env path is slotted into...
Read more >
Python Development Environment on MacOS - Hacker Codex
While installing Python and Virtualenv on macOS Monterey and Big Sur can be done several ways, this tutorial will guide you through the ......
Read more >
Python Virtual Environments: A Primer
In this tutorial, you'll learn how to work with Python's venv module to create and manage separate virtual environments for your Python ...
Read more >
Installing - angr Documentation
Fish (shell) users can either use virtualfish or the virtualenv package: vf new angr ... Mac OS X. pip install angr should work,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found