Click here to Skip to main content
15,938,218 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
"requirements.txt" file-
BareNecessities==0.2.8
bcrypt==4.0.1
blinker==1.4
certifi==2022.12.7
cffi
charset-normalizer==3.0.1
click==8.1.3
cmake==3.25.0
Flask==2.2.2
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
login==0.0.6
Mail==2.1.0
MarkupSafe==2.1.1
mysql==0.0.3
mysqlclient==2.1.1
Pillow==5.3.0
pycparser==2.18
pygame==2.1.3.dev8
PyJWT==2.6.0
python-dotenv==0.21.0
pytz==2022.7.1
requests==2.28.2
six==1.11.0
SQLAlchemy==1.2.7
twilio==7.16.1
urllib3==1.26.14
Werkzeug==2.2.2
wtf==0.1
WTForms==2.1


The error I am getting-
pip install -r requirements.txt
Collecting bcrypt==3.1.4
  Using cached bcrypt-3.1.4-cp34-abi3-manylinux1_x86_64.whl (51 kB)
Requirement already satisfied: blinker==1.4 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 2)) (1.4)
Collecting certifi==2016.2.28
  Using cached certifi-2016.2.28-py2.py3-none-any.whl (366 kB)
Collecting cffi==1.11.5
  Using cached cffi-1.11.5.tar.gz (438 kB)
  Preparing metadata (setup.py) ... done
Collecting click==6.7
  Using cached click-6.7-py2.py3-none-any.whl (71 kB)
Collecting Flask==1.0
  Using cached Flask-1.0-py2.py3-none-any.whl (97 kB)
Collecting Flask-Bcrypt==0.7.1
  Using cached Flask_Bcrypt-0.7.1-py3-none-any.whl
Collecting Flask-Login==0.4.1
  Using cached Flask_Login-0.4.1-py2.py3-none-any.whl
Collecting Flask-Mail==0.9.1
  Using cached Flask_Mail-0.9.1-py3-none-any.whl
Collecting Flask-SQLAlchemy==2.3.2
  Using cached Flask_SQLAlchemy-2.3.2-py2.py3-none-any.whl (16 kB)
Collecting Flask-WTF==0.14.2
  Using cached Flask_WTF-0.14.2-py2.py3-none-any.whl (14 kB)
Collecting itsdangerous==0.24
  Using cached itsdangerous-0.24.tar.gz (46 kB)
  Preparing metadata (setup.py) ... done
Collecting Jinja2==2.10
  Using cached Jinja2-2.10-py2.py3-none-any.whl (126 kB)
Collecting MarkupSafe==1.0
  Using cached MarkupSafe-1.0.tar.gz (14 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-wvxsr92x/markupsafe_8d36266c93dd4c0abf1c0526b63ae0b9/setup.py", line 6, in <module>
          from setuptools import setup, Extension, Feature
      ImportError: cannot import name 'Feature' from 'setuptools' (/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/setuptools/__init__.py)
      [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.


What I have tried:

I have tried changing "cffi" to "cffi==1.15.1", but the code still does not work.
Posted
Updated 18-Jan-23 4:06am
Comments
Richard MacCutchan 18-Jan-23 11:03am    
It looks like there is a problem with the installation of MarkupSafe. Try a separate install of that package in isolation.
Aalam Pratap Bedi 18-Jan-23 12:20pm    
I tried what you suggested but my code does not work.
Richard MacCutchan 18-Jan-23 12:36pm    
Sorry, that was a bit of a guess. But the real problem is the message that says:
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-wvxsr92x/markupsafe_8d36266c93dd4c0abf1c0526b63ae0b9/setup.py", line 6, in <module>
          from setuptools import setup, Extension, Feature
      ImportError: cannot import name 'Feature' from 'setuptools' (/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/setuptools/__init__.py)

which indicates that there is a missing file or class. Take a look in the setuptools directory to see if it is mis-spelled.
Aalam Pratap Bedi 18-Jan-23 13:09pm    
I checked 'setuptools' directory and there is no such file named 'Feature', as the error says. Kindly suggest me some other way to solve the problem.
Richard MacCutchan 19-Jan-23 4:19am    
Sorry, I don't know. The issue is that setup.py is trying to import a module that does not exist. Unfortuinately it is not possible to guess what it is trying to do. I would suggest trying to install the remaining packages, starting with MarkupSafe, one by one. You can then isolate which one(s) are causing the problem. You should then be able to go back to the source for the missing package and try again, or talk to the owners.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900