0

when I try to install the drawnow package, there are some mistakes.

I type

sudo pip install drawnow

it returns

pi@raspberrypi:~ $ sudo pip install drawnow
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting drawnow
  Using cached https://www.piwheels.org/simple/drawnow/drawnow-0.72.5-py3-none-any.whl (4.3 kB)
Collecting matplotlib>=1.5
  Using cached matplotlib-3.3.4.tar.gz (37.9 MB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-so6oyd3t/matplotlib_f0fbcfb46b7744ccaa8d8a56760c62db/setup.py'"'"'; __file__='"'"'/tmp/pip-install-so6oyd3t/matplotlib_f0fbcfb46b7744ccaa8d8a56760c62db/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-l50v6quo
         cwd: /tmp/pip-install-so6oyd3t/matplotlib_f0fbcfb46b7744ccaa8d8a56760c62db/
    Complete output (87 lines):
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 157, in save_modules
        yield saved
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context
        yield
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 248, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 278, in run
        return func()
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 246, in runner
        _execfile(setup_script, ns)
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 47, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-pc0vv8gr/numpy-1.20.1/setup.py", line 30, in <module>
        from setuptools import setup, find_packages, Extension
    RuntimeError: Python version >= 3.7 required.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-so6oyd3t/matplotlib_f0fbcfb46b7744ccaa8d8a56760c62db/setup.py", line 312, in <module>
        cmdclass=cmdclass,
      File "/usr/local/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 315, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 850, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1122, in best_match
        return self.obtain(req, installer)
      File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1134, in obtain
        return installer(requirement)
      File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 429, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 665, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 695, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 876, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1115, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1101, in run_setup
        run_setup(setup_script, args)
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 251, in run_setup
        raise
      File "/usr/local/lib/python3.6/contextlib.py", line 100, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context
        yield
      File "/usr/local/lib/python3.6/contextlib.py", line 100, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 169, in save_modules
        saved_exc.resume()
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 144, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/local/lib/python3.6/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 157, in save_modules
        yield saved
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context
        yield
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 248, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 278, in run
        return func()
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 246, in runner
        _execfile(setup_script, ns)
      File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 47, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-pc0vv8gr/numpy-1.20.1/setup.py", line 30, in <module>
        from setuptools import setup, find_packages, Extension
    RuntimeError: Python version >= 3.7 required.
    
    Edit setup.cfg to change the build options; suppress output with --quiet.
    
    BUILDING MATPLOTLIB
      matplotlib: yes [3.3.4]
          python: yes [3.6.1 (default, Mar  4 2021, 20:37:42)  [GCC 8.3.0]]
        platform: yes [linux]
     sample_data: yes [installing]
           tests: no  [skipping due to configuration]
          macosx: no  [Mac OS-X only]

7
  • I do not understand the question. What are you trying to do? E.g. what command are you running? What is the result? What did you expect to happen? EDIT this information into your question.
    – joan
    Mar 6 at 9:01
  • I failed to install the drawnow package and there is a contradiction between whereis python and python --version. I guess the python environment causes the failure.
    – ginne yu
    Mar 6 at 9:16
  • Do not post illegible pictures post text.
    – Milliways
    Mar 6 at 9:41
  • "uninstalled the python2.7" i.e. you broke the OS. Start from scratch and DON'T DELETE things.
    – Milliways
    Mar 6 at 10:53
  • Thank you for the advice.I have edited the question and put the code.
    – ginne yu
    Mar 6 at 10:55
0

Thank Milliways for his help.

As he said, the mistake happened as I uninstalled the python2 from my raspberry pi OS, which is a part of the operation system.

I reinstall the raspberry pi OS, and install python3

pip install python3

delete the link before

sudo rm /usr/bin/python

build up a new link to the python3 I have just installed

sudo ln -s /usr/bin/python3.7 /usr/bin/python

tips: the 3.7 in the code could be changed. The python you installed decides the number you code (such as 3.5 or 3.6)

coding python, you will see the default python in the raspberry pi.

then

sudo pip3 install drawnow

Using the method above, I successfully install the drawnow package on raspberry pi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.