Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install Jupyter for python 2.7 due to setuptools not being the right version

I am developing a plugin that must be developed in Python 2.7, not Python 3, due to the application it is for requiring it. I recently upgraded to PyCharm Professional and was hoping to use the built in Jupyter support for some testing. However it says "Jupyter is not installed." I have used Jupyter Notebook for Python 2.7 before, but had to start the server from Python 3 and then launch a kernel using Python 2.7 (which was a nightmare in itself due to the accent in my name.) When trying to install Jupyter in my Python 2.7 interpreter (using "pip install jupyter"), it complains that there was "No matching distribution found for setuptools~=53.0.0". On some googling and testing, I have found that in Python 2.7 setuptools cannot be updated beyond 44.1.1.

One thing that I REALLY hope is not relevant but has been the bane of my Python 2.7 coding life so I will mention it: My user folder has an accent in it due to the fact that my name is Réka. I have done everything in my power to route things to the C:\ folder instead, but it persists in looking at things in my user folder, which sometimes causes issues.

I think it is also complaining about a package called "maturin" but I am having trouble parsing the error. If anyone would like to look, here is the full error text (with my username removed):

  ERROR: Command errored out with exit status 1:
   command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\[user]\appdata\local\temp\pip-build-env-vf2hqh\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- maturin
       cwd: None
  Complete output (14 lines):
  DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
  Collecting maturin
    Using cached maturin-0.11.4.tar.gz (468 kB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\[user]\appdata\local\temp\pip-build-env-hqfzre\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools~=53.0.0' 'wheel~=0.36.2' 'toml~=0.10.2'
         cwd: None
    Complete output (3 lines):
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
    ERROR: Could not find a version that satisfies the requirement setuptools~=53.0.0 (from versions: 0.6b1, [cut for length, was just a list of versions], 44.1.1)
    ERROR: No matching distribution found for setuptools~=53.0.0
    ----------------------------------------
  ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\[user]\appdata\local\temp\pip-build-env-hqfzre\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools~=53.0.0' 'wheel~=0.36.2' 'toml~=0.10.2' Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\[user]\appdata\local\temp\pip-build-env-vf2hqh\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- maturin Check the logs for full command output.

I would like to know if there is an earlier version of Jupyter or something that is compatible with setuptools 44.1.1 that I could install - maybe I'm not googling the right things, but I haven't been able to find one. I can use my Python 2.7 kernel so it's not a blocking issue, but it would be very nice to be able to use Jupyter directly from PyCharm instead.

Edit: I attempted Dejun Ling's answer, installing pywinpty version 0.5.7, and received this error:

Collecting pywinpty==0.5.7
  Downloading pywinpty-0.5.7-cp27-cp27m-win32.whl (1.3 MB)

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
ERROR: Exception:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip\_internal\cli\base_command.py", line 223, in _main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip\_internal\cli\req_command.py", line 180, in wrapper
    return func(self, options, args)
  File "C:\Python27\lib\site-packages\pip\_internal\commands\install.py", line 321, in run
    reqs, check_supported_wheels=not options.target_dir
  File "C:\Python27\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 180, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "C:\Python27\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 385, in _resolve_one
    dist = self._get_dist_for(req_to_install)
  File "C:\Python27\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 337, in _get_dist_for
    dist = self.preparer.prepare_linked_requirement(req)
  File "C:\Python27\lib\site-packages\pip\_internal\operations\prepare.py", line 480, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "C:\Python27\lib\site-packages\pip\_internal\operations\prepare.py", line 505, in _prepare_linked_requirement
    self.download_dir, hashes,
  File "C:\Python27\lib\site-packages\pip\_internal\operations\prepare.py", line 257, in unpack_url
    hashes=hashes,
  File "C:\Python27\lib\site-packages\pip\_internal\operations\prepare.py", line 130, in get_http_url
    from_path, content_type = download(link, temp_dir.path)
  File "C:\Python27\lib\site-packages\pip\_internal\network\download.py", line 163, in __call__
    for chunk in chunks:
  File "C:\Python27\lib\site-packages\pip\_internal\cli\progress_bars.py", line 168, in iter
    for x in it:
  File "C:\Python27\lib\site-packages\pip\_internal\network\utils.py", line 88, in response_chunks
    decode_content=False,
  File "C:\Python27\lib\site-packages\pip\_vendor\urllib3\response.py", line 576, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "C:\Python27\lib\site-packages\pip\_vendor\urllib3\response.py", line 541, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "C:\Python27\lib\contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Python27\lib\site-packages\pip\_vendor\urllib3\response.py", line 449, in _error_catcher
    raise SSLError(e)
SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1946)
like image 240
Réka Avatar asked Mar 03 '26 17:03

Réka


1 Answers

  1. pycharm -> file -> setting -> project -> add avilable packages
  2. search pywinpty and select 0.5.7
  3. on you pycharm terimal use command: pip install jupyter maturin==0.7.6

see image of the command

like image 57
Dejun Ling Avatar answered Mar 05 '26 11:03

Dejun Ling