transifex / transifex-client

The Transifex command-line tool.
https://www.transifex.com/
GNU General Public License v2.0
136 stars 76 forks source link

Cannot install, pkg_resources.DistributionNotFound: 'requests<3.0.0,>=2.19.1' #286

Closed jakunico closed 4 years ago

jakunico commented 4 years ago

Hey, I'm attempting to install the Transifex client without luck. Here is the output of installing with pip:

nicolass-mini:~ nicolasjakubowski$ sudo pip install transifex-client
Password:
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
WARNING: The directory '/Users/nicolasjakubowski/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/nicolasjakubowski/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
ERROR: Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_internal/cli/base_command.py", line 178, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_internal/commands/install.py", line 352, in run
    resolver.resolve(requirement_set)
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_internal/resolve.py", line 131, in resolve
    self._resolve_one(requirement_set, req)
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_internal/resolve.py", line 294, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_internal/resolve.py", line 232, in _get_abstract_dist_for
    skip_reason = self._check_skip_installed(req)
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_internal/resolve.py", line 184, in _check_skip_installed
    req_to_install.check_if_exists(self.use_user_site)
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_internal/req/req_install.py", line 405, in check_if_exists
    self.req.name
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 481, in get_distribution
    dist = get_provider(dist)
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 357, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Library/Python/2.7/site-packages/pip-19.1.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
ContextualVersionConflict: (urllib3 1.25.8 (/Library/Python/2.7/site-packages), Requirement.parse('urllib3<1.24'), set(['transifex-client']))

Then I tried using the sources as explained in your installation guide:

nicolass-mini:transifex-client nicolasjakubowski$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to transifex_client.egg-info/requires.txt
writing transifex_client.egg-info/PKG-INFO
writing top-level names to transifex_client.egg-info/top_level.txt
writing dependency_links to transifex_client.egg-info/dependency_links.txt
writing entry points to transifex_client.egg-info/entry_points.txt
reading manifest file 'transifex_client.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'tx'
warning: no files found matching '*' under directory 'docs'
writing manifest file 'transifex_client.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.14-intel/egg
running install_lib
running build_py
creating build/bdist.macosx-10.14-intel/egg
creating build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/web.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/config.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/paths.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/log.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/cmdline.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/__init__.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/parsers.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/api.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/wizard.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/utils.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/messages.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/exceptions.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/cacert.pem -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/processors.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/urls.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/commands.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/__main__.py -> build/bdist.macosx-10.14-intel/egg/txclib
copying build/lib/txclib/project.py -> build/bdist.macosx-10.14-intel/egg/txclib
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/web.py to web.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/config.py to config.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/paths.py to paths.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/log.py to log.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/cmdline.py to cmdline.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/parsers.py to parsers.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/api.py to api.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/wizard.py to wizard.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/utils.py to utils.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/messages.py to messages.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/exceptions.py to exceptions.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/processors.py to processors.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/urls.py to urls.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/commands.py to commands.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/__main__.py to __main__.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/txclib/project.py to project.pyc
creating build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying transifex_client.egg-info/PKG-INFO -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying transifex_client.egg-info/SOURCES.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying transifex_client.egg-info/dependency_links.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying transifex_client.egg-info/entry_points.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying transifex_client.egg-info/not-zip-safe -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying transifex_client.egg-info/requires.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying transifex_client.egg-info/top_level.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
creating 'dist/transifex_client-0.13.8-py2.7.egg' and adding 'build/bdist.macosx-10.14-intel/egg' to it
removing 'build/bdist.macosx-10.14-intel/egg' (and everything under it)
Processing transifex_client-0.13.8-py2.7.egg
creating /Library/Python/2.7/site-packages/transifex_client-0.13.8-py2.7.egg
Extracting transifex_client-0.13.8-py2.7.egg to /Library/Python/2.7/site-packages
Adding transifex-client 0.13.8 to easy-install.pth file
Installing tx script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/transifex_client-0.13.8-py2.7.egg
Processing dependencies for transifex-client==0.13.8
Searching for python-slugify==1.2.6
Best match: python-slugify 1.2.6
Processing python_slugify-1.2.6-py2.7.egg
python-slugify 1.2.6 is already the active version in easy-install.pth
Installing slugify script to /usr/local/bin

Using /Library/Python/2.7/site-packages/python_slugify-1.2.6-py2.7.egg
Searching for requests==2.22.0
Best match: requests 2.22.0
Adding requests 2.22.0 to easy-install.pth file

Using /Users/nicolasjakubowski/Library/Python/2.7/lib/python/site-packages
Searching for six==1.11.0
Best match: six 1.11.0
Adding six 1.11.0 to easy-install.pth file

Using /Library/Python/2.7/site-packages
Searching for urllib3==1.25.8
Best match: urllib3 1.25.8
Processing urllib3-1.25.8-py2.7.egg
urllib3 1.25.8 is already the active version in easy-install.pth

Using /Library/Python/2.7/site-packages/urllib3-1.25.8-py2.7.egg
Searching for Unidecode==1.1.0
Best match: Unidecode 1.1.0
Adding Unidecode 1.1.0 to easy-install.pth file
Installing unidecode script to /usr/local/bin

Using /Users/nicolasjakubowski/Library/Python/2.7/lib/python/site-packages
Searching for idna==2.8
Best match: idna 2.8
Adding idna 2.8 to easy-install.pth file

Using /Users/nicolasjakubowski/Library/Python/2.7/lib/python/site-packages
Searching for chardet==3.0.4
Best match: chardet 3.0.4
Adding chardet 3.0.4 to easy-install.pth file
Installing chardetect script to /usr/local/bin

Using /Users/nicolasjakubowski/Library/Python/2.7/lib/python/site-packages
Searching for certifi==2019.6.16
Best match: certifi 2019.6.16
Adding certifi 2019.6.16 to easy-install.pth file

Using /Users/nicolasjakubowski/Library/Python/2.7/lib/python/site-packages
Finished processing dependencies for transifex-client==0.13.8
nicolass-mini:transifex-client nicolasjakubowski$ 

Then I run tx --version:

nicolass-mini:transifex-client nicolasjakubowski$ tx --version
Traceback (most recent call last):
  File "/usr/local/bin/tx", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3095, in <module>
    @_call_aside
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3081, in _call_aside
    f(*args, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 658, in _build_master
    ws.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 959, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 846, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'requests<3.0.0,>=2.19.1' distribution was not found and is required by transifex-client
nicolass-mini:transifex-client nicolasjakubowski$ 

I'm on macOS 10.14.16. Please advice

adimitrokalis commented 4 years ago

Hello

I would recommend the following installation method outlined in our documentation: https://docs.transifex.com/client/installing-the-client#installing-the-client-from-source

If that does not work, I would install in a virtual environment using the following commands:

$mkdir virtu_env_new
$ cd virtu_env_new/
$virtualenv venv --distribute
$virtualenv venv --distribute --system-site-packages
$source venv/bin/activate
$pip install transifex-client==0.13.8

Finally, check if the correct TX client version has been installed: $ tx --version

If neither of these work then please let us know.

Kind Regards,

Anthony

jakunico commented 4 years ago

Thanks Anthony, I was finally able to make it work by running:

$ sudo pip uninstall transifex-client
$ sudo -H pip install transifex-client