Skip to content
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

2.8.1 is the latest version from pip #7181

Closed
jorgeorpinel opened this issue Dec 21, 2021 · 13 comments
Closed

2.8.1 is the latest version from pip #7181

jorgeorpinel opened this issue Dec 21, 2021 · 13 comments

Comments

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Dec 21, 2021

Is that normal? Maybe it's just my system? My py env is def. messy rn...

Originally posted by @jorgeorpinel in #7143 (comment)


UPDATE 1: Reason in #7181 (comment)

UPDATE 2: Resolution in #7181 (comment)

@pmrowla
Copy link
Contributor

pmrowla commented Dec 21, 2021

The latest version from pip is 2.9.2: https://pypi.org/project/dvc/#history. There's something wrong with your local python environment/config.

on my machine:

~   ❯ mkvirtualenv fresh-dvc
created virtual environment CPython3.9.9.final.0-64 in 537ms
~  py:fresh-dvc ❯ pip install dvc
Collecting dvc
  Downloading dvc-2.9.2-py3-none-any.whl (389 kB)
     |████████████████████████████████| 389 kB 10.9 MB/s
...
Successfully installed ...
~  py:fresh-dvc ❯ rehash
~  py:fresh-dvc ❯ dvc doctor
DVC version: 2.9.2 (pip)
---------------------------------
Platform: Python 3.9.9 on macOS-12.1-x86_64-i386-64bit
Supports:
        webhdfs (fsspec = 2021.11.1),
        http (aiohttp = 3.8.1, aiohttp-retry = 2.4.6),
        https (aiohttp = 3.8.1, aiohttp-retry = 2.4.6)
~  py:fresh-dvc ❯ which dvc
/Users/pmrowla/.virtualenvs/fresh-dvc/bin/dvc

@efiop efiop added the awaiting response we are waiting for your reply, please respond! :) label Dec 21, 2021
@jorgeorpinel
Copy link
Contributor Author

Hmmm OK shouldn't be a problem then. Hopefully I can fix up my env.

@jorgeorpinel
Copy link
Contributor Author

Thanks

@pmrowla pmrowla removed the awaiting response we are waiting for your reply, please respond! :) label Dec 21, 2021
@skshetry
Copy link
Member

skshetry commented Dec 22, 2021

Per #7143 (comment), the Python version is 3.6.

We dropped support for Python 3.6 in 2.8.2, so the last version to support 3.6 is 2.8.1 which is why it's being installed.

@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Dec 28, 2021

That explains it! So should we specify our Python 3.7 dependency (and pip on it) in install docs like https://dvc.org/doc/install/macos#install-with-pip ? Otherwise it probably won't be obvious to others in my situation why pip won't install the latest DVC. Or use something like python3.7 -m pip install --upgrade dvc which implies it.

@jorgeorpinel
Copy link
Contributor Author

p.s. that last command is giving me an error though.

...
Collecting flufl.lock>=5 (from dvc)
  Using cached https://files.pythonhosted.org/packages/f4/3d/2f24d5661a51585507fede31ec6d4c4ba94366efbe046bfa6d7e8ce0425b/flufl.lock-6.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-_xzvuytw/flufl.lock/setup.py", line 4, in <module>
        from setuptools import setup, find_namespace_packages
    ImportError: cannot import name 'find_namespace_packages' from 'setuptools' (/usr/lib/python3/dist-packages/setuptools/__init__.py)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_xzvuytw/flufl.lock/

@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Dec 28, 2021

p.p.s. upgraded my global pip like this and it runs the install but it's much longer and it throws a bunch of flufl.lock errors and ends up installing DVC 2.8.1 anyway 😢 (even when it states it's going to install 2.9.3 initially). Not sure whether it's just my env so not reopening this for now.

@pmrowla
Copy link
Contributor

pmrowla commented Dec 28, 2021

You probably need to do

pip install -U setuptools
pip install -U pip

On the docs side, it probably makes sense for us to make it clearer what the minimum supported python version is, it's currently only stated in the venv/pipx note:

We strongly recommend creating a virtual environment or using pipx (on Python 3.7+) to encapsulate your local environment.

It would be better if it was noted more explicitly that 3.7+ is a hard requirement.

But beyond that, IMO it should be safe for us to assume that anyone choosing the "install via pip" method (as opposed to using the binary or conda packages) should already understand how to set up a python/pip environment on their machine. Providing support and documentation for keeping python/pip up-to-date is out of scope for us.

Users that aren't familiar with managing python themselves should already be using the system packages (or conda) which handles all of that for them.

@pmrowla
Copy link
Contributor

pmrowla commented Dec 28, 2021

p.p.s. upgraded my global pip like this and it runs the install but it's much longer and it throws a bunch of flufl.lock errors and ends up installing DVC 2.8.1 anyway 😢 (even when it states it's going to install 2.9.3 initially).

Assuming your linux distro's system python is 3.6, your "global" python/python3/pip/pip3 is always going to be python 3.6 unless you are already inside a virtualenv or are explicitly setting up something like pyenv to manage overriding the system python.

If you've installed a different python (like 3.7) from source or from a PPA, you will most likely always need to explicitly use python3.7 -m pip or pip3.7. This is a linux configuration issue, not a DVC issue.

@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Dec 28, 2021

pip install -U setuptools
pip install -U pip

Thanks @pmrowla ! I managed to upgrade my global pip in a different way (see #7181 (comment)) so this now reports Requirement already satisfied. But good to know

Assuming your linux distro's system python is 3.6 ...

I got Python 3.7 and pip 21 on it. I installed both manually.

~ python -V
Python 3.7.5
~  pip -V
pip 21.3.1 from /home/me/.local/lib/python3.7/site-packages/pip (python 3.7)

always need to explicitly use python3.7 -m pip or pip3.7

Unfort neither method is working for me as reported in #7181 (comment) and #7181 (comment), resp.

I'm on Ubuntu 18 on WSL 2 BTW.

@pmrowla
Copy link
Contributor

pmrowla commented Dec 28, 2021

What command are you using to install DVC? If you are trying to install DVC via pip, you should be using virtualenvs or pipx like we recommend in the docs, specifically because managing global/system pythons on most platforms is a giant mess (as you have encountered).

On ubuntu 18.04 (where the system python is 3.6) if you still want to install it "globally" for your user into ~/.local/lib/... you should be doing:

python3.7 -m pip install --user dvc

It's also possible that your system PATH is what makes it look like you are still installing DVC 2.8.1. Basically, you likely have more than one version of dvc installed in various places on your system, and the older one is taking priority based on your PATH env var.

what happens when you run which dvc

@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Dec 28, 2021

Yeah I prefer to have it globally for day-to-day. It probably works just fine in a venv (typically I use that route for dev versions instead).

python3.7 -m pip install --user dvc

This did the trick! (After I removed my global DVC with pip uninstall dvc)

you likely have more than one version of dvc installed

I don't think so 🙂 only had that one global pip-ed one which I just uninstalled.

Thanks again!

@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Dec 28, 2021

you likely have more than one version of dvc installed

I don't think so 🙂

Well, actually you were probably right since this is Windows underneath and I do have DVC installed from binary on there.

~  whereis dvc
dvc: /home/me/.local/bin/dvc /mnt/c/Program Files (x86)/DVC (Data Version Control)/dvc.exe /mnt/c/Users/me/AppData/Local/Programs/Python/Python38/Scripts/dvc.exe

But anyway, not a problem anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants