본문 바로가기

Python

pip install error / python project 실행 error

반응형

1.

 

아래와 같은 에러가 발생하면 ?? !!

Collecting moviepy

  Downloading https://files.pythonhosted.org/packages/c9/22/53d8477210c16133e5c0155c0686ca5324c24a1abcd825a82d95342282fd/moviepy-0.2.3.4.tar.gz (372kB)

    100% |████████████████████████████████| 378kB 366kB/s 

    Complete output from command python setup.py egg_info:

    error in moviepy setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.

    

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-m_zq76yn/moviepy/

 

 

아래의 명령어를 입력하고 다시 설치하면 이상 없이 설치된다. 

 

sudo -H pip install --upgrade --ignore-installed pip setuptools

 

 

http://melonicedlatte.com/android/2018/05/21/221524.html

 

에러 발생 Command python setup.py egg_info failed with error code 1 .. - Easy is Perfect

아래와 같은 에러가 발생하면 ?? !!  Collecting moviepy   Downloading https://files.pythonhosted.org/packages/c9/22/53d8477210c16133e5c0155c0686ca5324c24a1abcd825a82d95342282fd/moviepy-0.2.3.4.tar.gz (372kB)     100% |████████

melonicedlatte.com

 

2. pip install error

2-1.#include <ffi.h>
                ^~~~~~~
      compilation terminated.

더보기
sudo pip install bcrypt
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.
WARNING: The directory '/home/test/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting bcrypt
  Downloading bcrypt-3.1.7.tar.gz (42 kB)
     |████████████████████████████████| 42 kB 1.7 MB/s
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-UwREd9/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel 'cffi>=1.1; python_implementation != '"'"'PyPy'"'"''
       cwd: None
  Complete output (142 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.
  WARNING: The directory '/home/test/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  Collecting setuptools>=40.8.0
    Downloading setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
  Collecting wheel
    Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
  Collecting cffi>=1.1
    Downloading cffi-1.14.5.tar.gz (475 kB)
  Collecting pycparser
    Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
  Building wheels for collected packages: cffi
    Building wheel for cffi (setup.py): started
    Building wheel for cffi (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yQyBF7/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yQyBF7/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-FBdSpB
         cwd: /tmp/pip-install-yQyBF7/cffi/
    Complete output (56 lines):
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-2.7
    creating build/lib.linux-aarch64-2.7/cffi
    copying cffi/model.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/lock.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/recompiler.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/error.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/cparser.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/commontypes.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/__init__.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/api.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/verifier.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/_embedding.h -> build/lib.linux-aarch64-2.7/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-2.7/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-aarch64-2.7
    creating build/temp.linux-aarch64-2.7/c
    aarch64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-MQK6UF/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-aarch64-2.7/c/_cffi_backend.o
    c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
              ^~~~~~~
    compilation terminated.
    error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for cffi
    Running setup.py clean for cffi
  Failed to build cffi
  Installing collected packages: setuptools, wheel, pycparser, cffi
      Running setup.py install for cffi: started
      Running setup.py install for cffi: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yQyBF7/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yQyBF7/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-Sa4iyp/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-UwREd9/overlay --compile --install-headers /tmp/pip-build-env-UwREd9/overlay/include/python2.7/cffi
           cwd: /tmp/pip-install-yQyBF7/cffi/
      Complete output (56 lines):
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-2.7
      creating build/lib.linux-aarch64-2.7/cffi
      copying cffi/model.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/lock.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/recompiler.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/error.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/cparser.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/commontypes.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/__init__.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/api.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/verifier.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/_embedding.h -> build/lib.linux-aarch64-2.7/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-2.7/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-aarch64-2.7
      creating build/temp.linux-aarch64-2.7/c
      aarch64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-MQK6UF/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-aarch64-2.7/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
       #include <ffi.h>
                ^~~~~~~
      compilation terminated.
      error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yQyBF7/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yQyBF7/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-Sa4iyp/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-UwREd9/overlay --compile --install-headers /tmp/pip-build-env-UwREd9/overlay/include/python2.7/cffi Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-UwREd9/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel 'cffi>=1.1; python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.

solution

sudo apt-get install build-essential libssl-dev libffi-dev python-dev

or

sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
version에 따라 python-dev / python3-dev
잘됨..

https://bugs.launchpad.net/congress/+bug/1503095 

 

Bug #1503095 “Installation: fatal error: ffi.h: No such file or ...” : Bugs : congress

When installing Congress stand-alone, the following error occurs on executing pip install -r requirements.txt --------------- creating build/temp.linux-x86_64-2.7/c x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-p

bugs.launchpad.net

 

2-2. Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mu3tk5gw/bcrypt/

더보기

error

pip3 install bcrypt
Collecting bcrypt
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/d8/ba/21c475ead997ee21502d30f76fd93ad8d5858d19a3fad7cd153de698c4dd/bcrypt-3.2.0.tar.gz (42kB)
    100% |████████████████████████████████| 51kB 1.7MB/s
    Complete output from command python setup.py egg_info:
    c/_cffi_backend.c:2:10: fatal error: Python.h: No such file or directory
     #include <Python.h>
              ^~~~~~~~~~
    compilation terminated.
    Traceback (most recent call last):
      File "/usr/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
        extra_postargs)
      File "/usr/lib/python3.7/distutils/ccompiler.py", line 910, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/usr/lib/python3.7/distutils/spawn.py", line 36, in spawn
        _spawn_posix(cmd, search_path, dry_run=dry_run)
      File "/usr/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
        % (cmd, exit_status))
    distutils.errors.DistutilsExecError: command 'aarch64-linux-gnu-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 172, in run
        cmd = self.call_command('install_lib', warn_dir=0)
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 158, in call_command
        self.run_command(cmdname)
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 24, in run
        self.build()
      File "/usr/lib/python3.7/distutils/command/install_lib.py", line 109, in build
        self.run_command('build_ext')
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 78, in run
        _build_ext.run(self)
      File "/usr/lib/python3.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/usr/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "/usr/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 199, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
        depends=ext.depends)
      File "/usr/lib/python3.7/distutils/ccompiler.py", line 574, in compile
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/usr/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'aarch64-linux-gnu-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-x2ghktlt/cffi-1.14.5/setup.py", line 238, in <module>
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.7/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1163, in run_setup
        run_setup(setup_script, args)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/lib/python3/dist-packages/setuptools/_vendor/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-x2ghktlt/cffi-1.14.5/setup.py", line 238, in <module>
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.7/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-mu3tk5gw/bcrypt/setup.py", line 76, in <module>
        cmdclass={"test": PyTest},
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 128, in setup
        _install_setup_requires(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 123, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 513, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 774, in resolve
        replace_conflicting=replace_conflicting
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1057, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1069, in obtain
        return installer(requirement)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 580, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 698, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 724, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 909, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1177, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1165, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mu3tk5gw/bcrypt/

 

solution 1

python -m pip install -U pip
sudo apt-get install build-essential libssl-dev libffi-dev python-dev # python2.x
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev # python3.x
version에 따라 python-dev / python3-dev

solution2

sudo apt install libpython3.7-dev

https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory 

 

fatal error: Python.h: No such file or directory

I am trying to build a shared library using a C extension file but first I have to generate the output file using the command below: gcc -Wall utilsmodule.c -o Utilc After executing the command, I...

stackoverflow.com

https://stackoverflow.com/questions/14426491/python-3-importerror-no-module-named-setuptools

 

Python 3: ImportError "No Module named Setuptools"

I'm having troubles with installing packages in Python 3. I have always installed packages with setup.py install. But now, when I try to install the ansicolors package I get: importerror "No M...

stackoverflow.com

https://stackoverflow.com/questions/41492878/command-x86-64-linux-gnu-gcc-failed-with-exit-status-1

 

command 'x86_64-linux-gnu-gcc' failed with exit status 1

I tried to install "scholarly" package, but I keep receiving this error: x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -

stackoverflow.com

https://pip.pypa.io/en/stable/installing/#upgrading-pip

 

Installation - pip documentation v21.1.2

Previous Quickstart

pip.pypa.io

 

 

 

3. 

python app.py
  File "app.py", line 164
SyntaxError: Non-ASCII character '\xec' in file app.py on line 164, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

solution

스크립트 첫 부분에

# -*- coding: utf-8 -*-

 주석을 추가해주면 된다.

EX)

#app.py
#스크립트 첫 부분에  \# -\*- coding: <encoding-name> -\*- 구문을 추가하고 실행하면 'SyntaxError: Non=ASCII character ...' 에러는 사라진다. 'utf-8' 인코딩을 사용할 수 없는 경우라면, 'euc-kr'도 있고 지원되는 인코딩이 다양하니 찾아서 알맞은 걸 선언해주면 된다.

# -*- coding: utf-8 -*-
from datetime import date, datetime, timedelta
from re import X
from socket import timeout

 

4. fstring SyntaxError: invalid syntax

더보기

 

5. ModuleNotFoundError: No module named 'nacl._sodium'

더보기
python3 app.py
Traceback (most recent call last):
  File "app.py", line 13, in <module>
    from paramiko import SSHClient
  File "/home/test/.local/lib/python3.7/site-packages/paramiko/__init__.py", line 22, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/home/test/.local/lib/python3.7/site-packages/paramiko/transport.py", line 90, in <module>
    from paramiko.ed25519key import Ed25519Key
  File "/home/test/.local/lib/python3.7/site-packages/paramiko/ed25519key.py", line 22, in <module>
    import nacl.signing
  File "/usr/lib/python3/dist-packages/nacl/signing.py", line 19, in <module>
    import nacl.bindings
  File "/usr/lib/python3/dist-packages/nacl/bindings/__init__.py", line 17, in <module>
    from nacl.bindings.crypto_box import (
  File "/usr/lib/python3/dist-packages/nacl/bindings/crypto_box.py", line 18, in <module>
    from nacl._sodium import ffi, lib
ModuleNotFoundError: No module named 'nacl._sodium'

 

solution

pip3 uninstall pynacl
pip3 install pynacl

 

 

 

https://github.com/Miserlou/Zappa/issues/1033

 

NaCl ModuleNotFoundError. Issue deploying prebuilt wheel from Windows? · Issue #1033 · Miserlou/Zappa

Context I'm using paramiko which uses PyNaCl. After deploying, I get an error log that finishes with: File "/var/task/paramiko/__init__.py", line 31, in from paramiko.t...

github.com

 

반응형

'Python' 카테고리의 다른 글

pip not found windows  (0) 2021.09.17
[Python] Python 기초 / 초보 / 유용 사이트  (0) 2021.07.09
[Python] logging  (0) 2021.06.09
[Python] Flask monitoring dashboard  (0) 2021.06.09
[Python/Mysql] Python MySQL Connection Pool (flask)  (0) 2021.06.08