CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.91k stars 235 forks source link

Fail to install with pip on MacOS 11.5.2 using Python 3.7.9 #170

Closed douglaslassance closed 2 years ago

douglaslassance commented 2 years ago
❯ sudo pip install PyInquirer==1.0.3
WARNING: The directory '/Users/user/Library/Caches/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 should use sudo's -H flag.
Collecting PyInquirer==1.0.3
  Downloading PyInquirer-1.0.3.tar.gz (27 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-qqqdkx0s/pyinquirer_23b366c6d14e46e1a7f1380c04ab8b8a/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-qqqdkx0s/pyinquirer_23b366c6d14e46e1a7f1380c04ab8b8a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-z5j0iug5
       cwd: /private/tmp/pip-install-qqqdkx0s/pyinquirer_23b366c6d14e46e1a7f1380c04ab8b8a/
  Complete output (13 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
      from setuptools.dist import Distribution
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 38, in <module>
      from setuptools import windows_support
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
      import ctypes
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 7, in <module>
      from _ctypes import Union, Structure, Array
  ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so, 2): Library not loaded: /opt/local/lib/libffi.7.dylib
    Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so
    Reason: image not found
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/fb/4c/434b7c454010a284b49d6f1d446fe8dc5960415613d8c0225b9e2efb6724/PyInquirer-1.0.3.tar.gz#sha256=c9a92d68d7727fbd886a7908c08fd9e9773e5dc211bf5cbf836ba90d366dee51 (from https://pypi.org/simple/pyinquirer/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement PyInquirer==1.0.3 (from versions: 1.0.0, 1.0.2, 1.0.3)
ERROR: No matching distribution found for PyInquirer==1.0.3
guedesfelipe commented 2 years ago

is there a need to run as sudo?

douglaslassance commented 2 years ago

Without sudo:

❯ pip install PyInquirer
Defaulting to user installation because normal site-packages is not writeable
Collecting PyInquirer
  Using cached PyInquirer-1.0.3.tar.gz (27 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-install-6h_rlu90/pyinquirer_2367b4fdf00544b9ac0feb805b517fdc/setup.py'"'"'; __file__='"'"'/private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-install-6h_rlu90/pyinquirer_2367b4fdf00544b9ac0feb805b517fdc/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-pip-egg-info-5p64r7hh
       cwd: /private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-install-6h_rlu90/pyinquirer_2367b4fdf00544b9ac0feb805b517fdc/
  Complete output (13 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
      from setuptools.dist import Distribution
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 38, in <module>
      from setuptools import windows_support
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
      import ctypes
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 7, in <module>
      from _ctypes import Union, Structure, Array
  ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so, 2): Library not loaded: /opt/local/lib/libffi.7.dylib
    Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so
    Reason: image not found
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/fb/4c/434b7c454010a284b49d6f1d446fe8dc5960415613d8c0225b9e2efb6724/PyInquirer-1.0.3.tar.gz#sha256=c9a92d68d7727fbd886a7908c08fd9e9773e5dc211bf5cbf836ba90d366dee51 (from https://pypi.org/simple/pyinquirer/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading PyInquirer-1.0.2.tar.gz (16 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-install-6h_rlu90/pyinquirer_93344eb33cb94442b821b11f0f78bfab/setup.py'"'"'; __file__='"'"'/private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-install-6h_rlu90/pyinquirer_93344eb33cb94442b821b11f0f78bfab/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-pip-egg-info-x7x9j707
       cwd: /private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-install-6h_rlu90/pyinquirer_93344eb33cb94442b821b11f0f78bfab/
  Complete output (13 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
      from setuptools.dist import Distribution
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 38, in <module>
      from setuptools import windows_support
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
      import ctypes
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 7, in <module>
      from _ctypes import Union, Structure, Array
  ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so, 2): Library not loaded: /opt/local/lib/libffi.7.dylib
    Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so
    Reason: image not found
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/a1/d6/96bbc6eed40ef0b8b2dbe0da29a60130baff741091326760fb9f286a7929/PyInquirer-1.0.2.tar.gz#sha256=24297de0dea639d8427447753d9e4c7e584e0fdb048bf61703de9ff1f28394b2 (from https://pypi.org/simple/pyinquirer/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading PyInquirer-1.0.0.tar.gz (17 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-install-6h_rlu90/pyinquirer_bfc64819174a43a2a96ca45e85997ed1/setup.py'"'"'; __file__='"'"'/private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-install-6h_rlu90/pyinquirer_bfc64819174a43a2a96ca45e85997ed1/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-pip-egg-info-85of8dot
       cwd: /private/var/folders/nc/3ll6c4wd0x9237vp06j5vbmh0000gn/T/pip-install-6h_rlu90/pyinquirer_bfc64819174a43a2a96ca45e85997ed1/
  Complete output (13 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
      from setuptools.dist import Distribution
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 38, in <module>
      from setuptools import windows_support
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
      import ctypes
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 7, in <module>
      from _ctypes import Union, Structure, Array
  ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so, 2): Library not loaded: /opt/local/lib/libffi.7.dylib
    Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so
    Reason: image not found
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/e8/7b/d48bdf04e6cfd937b72d7f4eb83f8dae722a1fea69661d4893ef7c4596e0/PyInquirer-1.0.0.tar.gz#sha256=55ee8198264d7f4eb61e677cd8932fa61f90746db8c9414977a6818a091b9d22 (from https://pypi.org/simple/pyinquirer/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement PyInquirer (from versions: 1.0.0, 1.0.2, 1.0.3)
ERROR: No matching distribution found for PyInquirer
guedesfelipe commented 2 years ago

Can you try to install with pip install PyInquirer --verbose and put here the output? I ran a test here on version 3.7.9 of python and MacOS 11.6.1 and it worked perfectly.

douglaslassance commented 2 years ago

Using pip 21.3.1 from /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
Defaulting to user installation because normal site-packages is not writeable
Collecting PyInquirer
  Using cached PyInquirer-1.0.3.tar.gz (27 kB)
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
      from setuptools.dist import Distribution
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 38, in <module>
      from setuptools import windows_support
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
      import ctypes
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 7, in <module>
      from _ctypes import Union, Structure, Array
  ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so, 2): Library not loaded: /opt/local/lib/libffi.7.dylib
    Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so
    Reason: image not found
  Preparing metadata (setup.py) ... error
WARNING: Discarding https://files.pythonhosted.org/packages/fb/4c/434b7c454010a284b49d6f1d446fe8dc5960415613d8c0225b9e2efb6724/PyInquirer-1.0.3.tar.gz#sha256=c9a92d68d7727fbd886a7908c08fd9e9773e5dc211bf5cbf836ba90d366dee51 (from https://pypi.org/simple/pyinquirer/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached PyInquirer-1.0.2.tar.gz (16 kB)
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
      from setuptools.dist import Distribution
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 38, in <module>
      from setuptools import windows_support
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
      import ctypes
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 7, in <module>
      from _ctypes import Union, Structure, Array
  ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so, 2): Library not loaded: /opt/local/lib/libffi.7.dylib
    Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so
    Reason: image not found
  Preparing metadata (setup.py) ... error
WARNING: Discarding https://files.pythonhosted.org/packages/a1/d6/96bbc6eed40ef0b8b2dbe0da29a60130baff741091326760fb9f286a7929/PyInquirer-1.0.2.tar.gz#sha256=24297de0dea639d8427447753d9e4c7e584e0fdb048bf61703de9ff1f28394b2 (from https://pypi.org/simple/pyinquirer/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached PyInquirer-1.0.0.tar.gz (17 kB)
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
      from setuptools.dist import Distribution
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 38, in <module>
      from setuptools import windows_support
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
      import ctypes
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 7, in <module>
      from _ctypes import Union, Structure, Array
  ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so, 2): Library not loaded: /opt/local/lib/libffi.7.dylib
    Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so
    Reason: image not found
  Preparing metadata (setup.py) ... error
WARNING: Discarding https://files.pythonhosted.org/packages/e8/7b/d48bdf04e6cfd937b72d7f4eb83f8dae722a1fea69661d4893ef7c4596e0/PyInquirer-1.0.0.tar.gz#sha256=55ee8198264d7f4eb61e677cd8932fa61f90746db8c9414977a6818a091b9d22 (from https://pypi.org/simple/pyinquirer/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement PyInquirer (from versions: 1.0.0, 1.0.2, 1.0.3)
ERROR: No matching distribution found for PyInquirer```
douglaslassance commented 2 years ago

Found people talking about this here. sudo ln /opt/local/lib/libffi.8.dylib /opt/local/lib/libffi.7.dylib fixed it for me. Not sure how this lib got to be missing in the first place.

guedesfelipe commented 2 years ago

if it worked, you can close the issue

farzammpm commented 2 years ago

Found people talking about this here. sudo ln /opt/local/lib/libffi.8.dylib /opt/local/lib/libffi.7.dylib fixed it for me. Not sure how this lib got to be missing in the first place.

yes it does, but be prepared, your system will explode sooner or later and you will have to re-install it all, all over again from scratch... one should never manually link.