Week1 assignment pip install error

Hi~
when I ran the first cell which install required modules, The following error occurs :smiling_face_with_tear:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
distributed 2022.7.0 requires tornado<6.2,>=6.0.3, but you have tornado 6.3.2 which is incompatible.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  error: subprocess-exited-with-error
  
  Γ— Building wheel for pandas (pyproject.toml) did not run successfully.
  β”‚ exit code: 1
  ╰─> [1284 lines of output]

...

note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pandas
ERROR: Could not build wheels for pandas, which is required to install pyproject.toml-based projects
ERROR: Ignored the following versions that require a different python version: 1.0.0 Requires-Python >=3.6, <3.9; 1.0.1 Requires-Python >=3.6, <3.9; 1.0.2 Requires-Python >=3.6, <3.9; 1.0.3 Requires-Python >=3.6, <3.9; 1.0.4 Requires-Python >=3.6, <3.9; 1.1.0 Requires-Python >=3.6, <3.9; 1.1.1 Requires-Python >=3.6, <3.9; 1.1.2 Requires-Python >=3.6, <3.9; 1.10.0 Requires-Python >=3.6, <3.9; 1.10.1 Requires-Python >=3.6, <3.9; 1.2.0 Requires-Python >=3.6, <3.9; 1.3.0 Requires-Python >=3.6, <3.9; 1.4.0 Requires-Python >=3.6, <3.9; 1.5.0 Requires-Python >=3.6, <3.9; 1.6.0 Requires-Python >=3.6, <3.9; 1.6.1 Requires-Python >=3.6, <3.9; 1.6.2 Requires-Python >=3.6, <3.9; 1.6.3 Requires-Python >=3.6, <3.9; 1.7.0 Requires-Python >=3.6, <3.9; 1.8.0 Requires-Python >=3.6, <3.9; 1.8.1 Requires-Python >=3.6, <3.9; 1.9.0 Requires-Python >=3.6, <3.9; 1.9.1 Requires-Python >=3.6, <3.9; 1.9.2 Requires-Python >=3.6, <3.9; 1.9.3 Requires-Python >=3.6, <3.9; 1.9.4 Requires-Python >=3.6, <3.9; 1.9.5 Requires-Python >=3.6, <3.9; 1.9.6 Requires-Python >=3.6, <3.9; 2.0.0 Requires-Python >=3.6, <3.9; 2.0.1 Requires-Python >=3.6, <3.9; 2.1.0 Requires-Python >=3.6, <3.9; 2.10.0 Requires-Python >=3.6, <3.10; 2.11.0 Requires-Python >=3.6.2,<3.10; 2.12.0 Requires-Python >=3.6.2,<3.10; 2.12.1 Requires-Python >=3.6.2,<3.10; 2.13.0 Requires-Python >=3.6.2,<=3.10.0; 2.2.0 Requires-Python >=3.6, <3.9; 2.3.0 Requires-Python >=3.6, <3.9; 2.4.0 Requires-Python >=3.6, <3.10; 2.5.0 Requires-Python >=3.6, <3.10; 2.6.0 Requires-Python >=3.6, <3.10; 2.7.0 Requires-Python >=3.6, <3.10; 2.8.0 Requires-Python >=3.6, <3.10; 2.9.0 Requires-Python >=3.6, <3.10
ERROR: Could not find a version that satisfies the requirement awswrangler==2.7.0 (from versions: 0.0b0, 0.0b2, 0.0b3, 0.0b4, 0.0b5, 0.0b6, 0.0b7, 0.0b8, 0.0b9, 0.0b10, 0.0b11, 0.0b12, 0.0b13, 0.0b14, 0.0b15, 0.0b16, 0.0b17, 0.0b18, 0.0b19, 0.0b20, 0.0b21, 0.0b22, 0.0b23, 0.0b24, 0.0b25, 0.0b26, 0.0b27, 0.0b28, 0.0b29, 0.0b30, 0.0b31, 0.0b32, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.14, 0.0.15, 0.0.16, 0.0.17, 0.0.18, 0.0.19, 0.0.20, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.25, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.3.0, 0.3.1, 0.3.2, 2.14.0, 2.15.0, 2.15.1, 2.16.0, 2.16.1, 2.17.0, 2.18.0, 2.19.0, 2.20.0, 2.20.1, 3.0.0a1, 3.0.0a2, 3.0.0b1, 3.0.0b2, 3.0.0b3, 3.0.0rc1, 3.0.0rc2, 3.0.0rc3, 3.0.0, 3.1.0, 3.1.1, 3.2.0, 3.2.1)
ERROR: No matching distribution found for awswrangler==2.7.0
  error: subprocess-exited-with-error
  
  Γ— Preparing metadata (pyproject.toml) did not run successfully.
  β”‚ exit code: 1
  ╰─> [55 lines of output]
      Running from numpy source directory.
      <string>:461: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      /tmp/pip-install-_l_smddu/numpy_cbecabc0c69a4d6e85c98712caae1d83/tools/cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        required_version = LooseVersion('0.29.14')
      /tmp/pip-install-_l_smddu/numpy_cbecabc0c69a4d6e85c98712caae1d83/tools/cythonize.py:77: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cython_version) < required_version:
      warning: /tmp/pip-install-_l_smddu/numpy_cbecabc0c69a4d6e85c98712caae1d83/numpy/__init__.pxd:17:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              for i in range(1, RK_STATE_LEN):
                  self.rng_state.key[i] = val[i]
              self.rng_state.pos = i
      
              self._bitgen.state = &self.rng_state
              self._bitgen.next_uint64 = &mt19937_uint64
                                         ^
      ------------------------------------------------------------
      
      _mt19937.pyx:138:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil'
      Processing numpy/random/_bounded_integers.pxd.in
      Processing numpy/random/_mt19937.pyx
      Traceback (most recent call last):
        File "/tmp/pip-install-_l_smddu/numpy_cbecabc0c69a4d6e85c98712caae1d83/tools/cythonize.py", line 238, in <module>
          main()
        File "/tmp/pip-install-_l_smddu/numpy_cbecabc0c69a4d6e85c98712caae1d83/tools/cythonize.py", line 234, in main
          find_process_files(root_dir)
        File "/tmp/pip-install-_l_smddu/numpy_cbecabc0c69a4d6e85c98712caae1d83/tools/cythonize.py", line 225, in find_process_files
          process(root_dir, fromfile, tofile, function, hash_db)
        File "/tmp/pip-install-_l_smddu/numpy_cbecabc0c69a4d6e85c98712caae1d83/tools/cythonize.py", line 191, in process
          processor_function(fromfile, tofile)
        File "/tmp/pip-install-_l_smddu/numpy_cbecabc0c69a4d6e85c98712caae1d83/tools/cythonize.py", line 80, in process_pyx
          subprocess.check_call(
        File "/opt/conda/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/opt/conda/bin/python', '-m', 'cython', '-3', '--fast-fail', '-o', '_mt19937.c', '_mt19937.pyx']' returned non-zero exit status 1.
      Cythonizing sources
      Traceback (most recent call last):
        File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/tmp/pip-build-env-abrwdlul/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 380, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-abrwdlul/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/tmp/pip-build-env-abrwdlul/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 488, in <module>
        File "<string>", line 469, in setup_package
        File "<string>", line 275, in generate_cython
      RuntimeError: Running cythonize failed!
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Γ— Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  error: subprocess-exited-with-error
  
  Γ— python setup.py bdist_wheel did not run successfully.
  β”‚ exit code: 1
  ╰─> [599 lines of output]
      
      Edit setup.cfg to change the build options; suppress output with --quiet.
      
      BUILDING MATPLOTLIB
        matplotlib: yes [3.3.3]
            python: yes [3.10.6 (main, Oct  7 2022, 20:19:58) [GCC 11.2.0]]
          platform: yes [linux]
       sample_data: yes [installing]
             tests: no  [skipping due to configuration]
            macosx: no  [Mac OS-X only]
      
      /opt/conda/lib/python3.10/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!
      
              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************
      
      !!
        dist.fetch_build_eggs(dist.setup_requires)
      /opt/conda/lib/python3.10/site-packages/setuptools/dist.py:955: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
      !!
      
              ********************************************************************************
              Please replace its usage with implicit namespaces (PEP 420).
      
              See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
              ********************************************************************************
      
      !!

...

note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for matplotlib
ERROR: Could not build wheels for matplotlib, which is required to install pyproject.toml-based projects

Hi, have you tried updating pip?

Thank you for replying!

I hadn’t thought about that but when I tried to install modules again after updating pip module, the same error message occured :smiling_face_with_tear: :smiling_face_with_tear:

Hi, have you tried:

pip install tornado==6.0.3

And as well, are you building everything inside a virtual environment? because the problems with β€˜root’ mean you have no sudo permissions. So I would say, first build a virtual environment and redo all the steps inside this virtual environment. Probably setting-up a proper virtual environment will get rid of all the errors with pandas, matplotlib, tornado, etc,…

It seems that what I did after seeing the error message was the reason of problem I faced. ^^;

when I ignored the error message and continued, and I was able to proceed without any problems, except for having to downgrade the version of one package in the middle.

Thank you for continuing to answer and help! :slight_smile:

1 Like

Hi, it is good to read you solve it :slight_smile:

Thank you for continuing to answer and help! :slight_smile:

you’re welcome, have a happy learning!

Do we need to upgrade pip?
or do we need to create virtual env?
I tried but its not working. Please tell the steps needs to be done?

Hi @parulmishra19,
What is the exact error?

Hi, Thanks for replying.
Everything worked as mentioned in the notebook. Just used Data Science 2.0 as kernel, updated pip and everything worked smoothly without creating virtual env.

1 Like