pprofile icon indicating copy to clipboard operation
pprofile copied to clipboard

Trying to install older version of pprofile

Open RandmTask opened this issue 3 years ago • 2 comments

Hi I can install the current version of pprofile just fine. I am trying to install v2.0.2 (for uni they are very specific about the version) and a few of us are having issues

I have an M1 MacBook Air and when trying to install a previous version of pprofile in miniconda I'm running into this error:

(mt) bin: $ pip install pprofile==2.0.2
Collecting pprofile==2.0.2
  Using cached pprofile-2.0.2.tar.gz (35 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/dfg/miniconda3/envs/mt/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/2y/xs2qf7ms04xbg9lyv_7s49c00000gn/T/pip-install-fnwm_ln5/pprofile_138821cbfeaf40d98bf1716762b7216d/setup.py'"'"'; __file__='"'"'/private/var/folders/2y/xs2qf7ms04xbg9lyv_7s49c00000gn/T/pip-install-fnwm_ln5/pprofile_138821cbfeaf40d98bf1716762b7216d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/2y/xs2qf7ms04xbg9lyv_7s49c00000gn/T/pip-pip-egg-info-drtrq3xd
         cwd: /private/var/folders/2y/xs2qf7ms04xbg9lyv_7s49c00000gn/T/pip-install-fnwm_ln5/pprofile_138821cbfeaf40d98bf1716762b7216d/
    Complete output (1 lines):
    error in pprofile setup command: use_2to3 is invalid.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/35/d9/360f4483f735cbd4f1ac7316f3bdbee06b5872355963b913f1a53871ac72/pprofile-2.0.2.tar.gz#sha256=3469102f462f9fc2d889970afcf73d89c0d89a36c49a4c262c3edc302b4a22da (from https://pypi.org/simple/pprofile/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pprofile==2.0.2 (from versions: 1.0, 1.0.1, 1.1, 1.2, 1.2.1, 1.3, 1.4, 1.4.1, 1.5, 1.6, 1.6.1, 1.6.2, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.9, 1.9.1, 1.9.2, 1.10.0, 1.10.1, 1.11.0, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.1.0)
ERROR: No matching distribution found for pprofile==2.0.2

I can install the latest version just fine. Would appreciate any help resolving this issue!

RandmTask avatar Jan 13 '23 10:01 RandmTask

error in pprofile setup command: use_2to3 is invalid.

use_2to3 is (was) present in setup.py to convert the syntax automatically from python2 to python3, allowing it to be installed on both version (and in the specific case of this module, the aim was to use the most efficient iteration methods, whose name changed between both language versions). This parameter was implemented by setuptools, but they dropped support for it. As a result, I did this change, which is in a newer pprofile version.

I think the most consistent direction which still complies with the constraints you are under would be to install a setuptools version before 58. But I have no idea of the ramifications of such downgrade (Will miniconda be happy with it ? Are there other conflicting dependencies to newer setuptools from other installed packages ?...). Maybe you can request the full list of versions, including all dependencies (including install-time dependencies, such as setuptools), your university wants you to use ? Surely they must have one such setup somewhere and should be able to list all installed packages and their versions.

vpelletier avatar Jan 15 '23 00:01 vpelletier

Yes,

They have provided this to set up the environment:

name: ml4t
channels:
- conda-forge
- defaults
dependencies:
- python=3.6
- cycler=0.10.0
- kiwisolver=1.1.0
- matplotlib=3.0.3
- numpy=1.16.3
- pandas=0.24.2
- pyparsing=2.4.0
- python-dateutil=2.8.0
- pytz=2019.1
- scipy=1.2.1
- seaborn=0.9.0
- six=1.12.0
- joblib=0.13.2
- pytest=5.0
- pytest-json=0.4.0
- future=0.17.1
- pprofile=2.0.2
- pip
- pip:
  - jsons==0.8.8
  - gradescope-utils
  - subprocess32

Thank you for your detailed response.

I don't see setuptools in the above list, so I went ahead and downgraded it and was able to download profile=2.0.2!

Hopefully that doesn't introduce more problems than it solves!

RandmTask avatar Jan 15 '23 12:01 RandmTask