I also came across this problem (while creating a simple installer for pyenv). Here’s how I solved it for Mac and Linux:
Ubuntu 20.04, 18.04
You need the zlib
development files, and probably zlib itself too:
sudo apt install -y zlib1g-dev zlibc
If you’re missing zlib, it’s likely that the next problem you’ll run into is with openssl, so it’s probably best to get that now as well:
sudo apt install -y libssl-dev sudo apt install -y libssl1.1 || sudo apt install -y libssl1.0
macOS
I believe this comes with XCode CLI Tools (or at least I didn’t have to custom install it Big Sur):
xcode-select --install
Related Posts:
- Django Rest Framework — no module named rest_framework
- How to install pip with Python 3?
- How to uninstall a package installed with pip install –user
- Where does pip install its packages?
- Where does pip install its packages?
- How to install python3 version of package via pip on Ubuntu?
- Could not find a version that satisfies the requirement tensorflow
- Could not find a version that satisfies the requirement tensorflow
- No module named ‘psycopg2’
- How to install pip3 on Windows?
- How can I install Python’s pip3 on my Mac?
- No module named pkg_resources
- What is the purpose of “pip install –user …”?
- ‘pip3’ is not recognized as an internal or external command, operable program or batch file
- How can I install Python’s pip3 on my Mac?
- python mpl_toolkits installation issue
- Pipenv: Command Not Found
- Pip – Fatal error in launcher: Unable to create process using ‘”‘
- pip install -r requirements.txt [Errno 2] No such file or directory: ‘requirements.txt’
- ImportError: No module named ‘yaml’
- TypeError: int() argument must be a string, a bytes-like object or a number, not ‘list’
- ImportError: No module named ‘django.core.urlresolvers’
- How to fix error “ERROR: Command errored out with exit status 1: python.” when trying to install django-heroku using pip
- pip throws TypeError: parse() got an unexpected keyword argument ‘transport_encoding’ when trying to install new packages
- How to install Openpyxl with pip
- How to install NumPy for Python 3.6
- Error loading MySQLdb module: No module named ‘MySQLdb’
- How to install PyQt4 on Windows using pip?
- How to install PyQt4 on Windows using pip?
- How to use filter, map, and reduce in Python 3
- Praw & Discord.py: The bot keep sending the same meme. I want the bot to send different meme whenever it is asked
- How is Anaconda related to Python?
- FileNotFoundError: [WinError 2] The system cannot find the file specified:
- How to correct TypeError: Unicode-objects must be encoded before hashing?
- Updating a dictionary in python
- django: TypeError: ‘tuple’ object is not callable
- ‘method’ object is not subscriptable. Don’t know what’s wrong
- NameError: global name ‘xrange’ is not defined in Python 3
- What does “SyntaxError: Missing parentheses in call to ‘print'” mean in Python?
- What is __pycache__?
- TypeError: can’t use a string pattern on a bytes-like object in re.findall()
- “ImportError: no module named ‘requests'” after installing with pip
- Python Setup Disabling Path Length Limit Pros and Cons?
- Type error: cannot convert the series to
- Could not find a version that satisfies the requirement
- How to upgrade all Python packages with pip
- How to remove punctuation marks from a string in Python 3.x using .translate()?
- What is the easiest way to remove all packages installed by pip?
- Infinite integer in Python
- How to use sys.exit() in Python
- Checking whether pip is installed?
- Django 2.1.3 Error: __init__() takes 1 positional argument but 2 were given
- AttributeError: Module Pip has no attribute ‘main’
- installing urllib in Python3.6
- What is sys.maxint in Python 3?
- Python: can’t assign to literal
- “Initializing” variables in python?
- Difference between except: and except Exception as e:
- “Unicode Error “unicodeescape” codec can’t decode bytes… Cannot open text files in Python 3
- How to downgrade python from 3.7 to 3.6
- How to return dictionary keys as a list in Python?
- How to save a dictionary to a file?
- Error: “dictionary update sequence element #0 has length 1; 2 is required” on Django 1.4
- Using Look Up Tables in Python
- How to run Pip commands from CMD
- How to install PyGame on Python 3.4?
- ImportError: No module named ‘cv2’ Python3
- Unsupported operation :not writeable python
- Python Django: You’re using the staticfiles app without having set the STATIC_ROOT setting
- sqlite3.OperationalError: unable to open database file
- Object of type ‘map’ has no len() in Python 3
- python NameError: name ‘file’ is not defined
- how to exit a python script in an if statement
- ImportError: No module named Crypto.Cipher
- Not able to pip install pickle in python 3.6
- How to set environment variables in PyCharm?
- Using unicode character u201c
- OperationalError: database is locked
- Decode Hex String in Python 3
- built-in range or numpy.arange: which is more efficient?
- Printing subscript in python
- How to clear Tkinter Canvas?
- TypeError: ‘range’ object does not support item assignment
- How to install pip for Python 3 on Mac OS X?
- Find object in list that has attribute equal to some value (that meets any condition)
- install csv package in pycharm
- dump() missing 1 required positional argument: ‘fp’ in python json
- Meaning of list[-1] in Python
- TypeError: module.__init__() takes at most 2 arguments (3 given)
- Tkinter error: Couldn’t recognize data in image file
- coercing to Unicode: need string or buffer, NoneType found when rendering in django admin
- Python cant convert ‘list’ object to str error [closed]
- Failed building wheel for Twisted in Windows 10 python 3
- How to query as GROUP BY in django?
- Generate a random letter in Python
- How to resolve “ImportError: DLL load failed:” on Python?
- ‘module’ has no attribute ‘urlencode’
- Install pip for python 3.5
- Python-3.2 coroutine: AttributeError: ‘generator’ object has no attribute ‘next’
- What is the most efficient way to store a list in the Django models?