Getting Error while running pip install -r requirements.txt after Annaconda

Here is the log, the process doesn’t allow me to put full log:

2022-05-24T15:26:10,344 ERROR: Could not find a version that satisfies the requirement cffi==1.13.1 (from versions: 0.1, 0.2, 0.2.1, 0.3, 0.4, 0.4.1, 0.4.2, 0.5, 0.6, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.9.0, 0.9.1, 0.9.2, 1.0.0, 1.0.1, 1.0.2.post2, 1.0.3, 1.1.0, 1.1.1, 1.1.2, 1.2.0.post1, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.4.2, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.2, 1.8.3, 1.9.0, 1.9.1, 1.10.0, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.11.4, 1.11.5, 1.12.0, 1.12.1, 1.12.2, 1.12.3, 1.13.0, 1.13.1, 1.13.2, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0)
2022-05-24T15:26:10,345 ERROR: No matching distribution found for cffi==1.13.1
2022-05-24T15:26:10,345 Exception information:
2022-05-24T15:26:10,345 Traceback (most recent call last):
2022-05-24T15:26:10,345   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 341, in resolve
2022-05-24T15:26:10,345     self._add_to_criteria(self.state.criteria, r, parent=None)
2022-05-24T15:26:10,345   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria
2022-05-24T15:26:10,345     raise RequirementsConflicted(criterion)
2022-05-24T15:26:10,345 pip._vendor.resolvelib.resolvers.RequirementsConflicted: Requirements conflict: SpecifierRequirement('cffi==1.13.1')
2022-05-24T15:26:10,345 
2022-05-24T15:26:10,345 During handling of the above exception, another exception occurred:
2022-05-24T15:26:10,345 
2022-05-24T15:26:10,345 Traceback (most recent call last):
2022-05-24T15:26:10,345   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 94, in resolve
2022-05-24T15:26:10,345     result = self._result = resolver.resolve(
2022-05-24T15:26:10,345   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 472, in resolve
2022-05-24T15:26:10,345     state = resolution.resolve(requirements, max_rounds=max_rounds)
2022-05-24T15:26:10,345   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 343, in resolve
2022-05-24T15:26:10,345     raise ResolutionImpossible(e.criterion.information)
2022-05-24T15:26:10,345 pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('cffi==1.13.1'), parent=None)]
2022-05-24T15:26:10,345 
2022-05-24T15:26:10,345 The above exception was the direct cause of the following exception:
2022-05-24T15:26:10,345 
2022-05-24T15:26:10,345 Traceback (most recent call last):
2022-05-24T15:26:10,345   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 173, in _main
2022-05-24T15:26:10,345     status = self.run(options, args)
2022-05-24T15:26:10,345   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_internal\cli\req_command.py", line 203, in wrapper
2022-05-24T15:26:10,345     return func(self, options, args)
2022-05-24T15:26:10,345   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 315, in run
2022-05-24T15:26:10,345     requirement_set = resolver.resolve(
2022-05-24T15:26:10,345   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 103, in resolve
2022-05-24T15:26:10,345     raise error from e
2022-05-24T15:26:10,345 pip._internal.exceptions.DistributionNotFound: No matching distribution found for cffi==1.13.1
2022-05-24T15:26:10,356 Removed cffi==1.13.1 from https://files.pythonhosted.org/packages/0d/aa/c5ac2f337d9a10ee95d160d47beb8d9400e1b2a46bb94990a0409fe6d133/cffi-1.13.1.tar.gz#sha256=558b3afef987cf4b17abd849e7bedf64ee12b28175d564d05b628a0f9355599b (from -r requirements.txt (line 6)) from build tracker 'C:\\Users\\mongoPy\\AppData\\Local\\Temp\\pip-req-tracker-uh880hug'
2022-05-24T15:26:10,356 Removed build tracker: 'C:\\Users\\mongoPy\\AppData\\Local\\Temp\\pip-req-tracker-uh880hug'

Hey @Nilesh_Dave,

Welcome to the MongoDB Community Forums! :leaves:

Which python version are you using? The course has been tested with Python 3.8 and this error usually happens when using an earlier/later version since the package gets deprecated in later versions or is not compatible with earlier versions.
To overcome this, you can simply remove the cffi package’s version number(ie. 1.13.1) in front of it from the requirement.txt file and let it install to the default available for that python version. This should let you install the package. Kindly do this for any other package as well if you face a similar issue for it.

Let us know if the problem still persists. Feel free to reach out for anything else as well.

Regards,
Satyam

Thanks Satyam,
I have python 3.9.12, I have downloaded yesterday only. by removing cffi it moved forward but it failed again. Sorry I am new to both python and mongodb so still finding my feet. Here is the new error log:

2022-05-25T10:05:36,645   {'libraries': ['libzmq'], 'include_dirs': [], 'library_dirs': [], 'runtime_library_dirs': [], 'extra_link_args': []}
2022-05-25T10:05:36,646   Warning: Couldn't find an acceptable libzmq on the system.

2022-05-25T10:05:36,646   If you expected pyzmq to link against an installed libzmq, please check to make sure:

2022-05-25T10:05:36,647       * You have a C compiler installed
2022-05-25T10:05:36,647       * A development version of Python is installed (including headers)
2022-05-25T10:05:36,647       * A development version of ZMQ >= 3.2 is installed (including headers)
2022-05-25T10:05:36,647       * If ZMQ is not in a default location, supply the argument --zmq=<path>
2022-05-25T10:05:36,647       * If you did recently install ZMQ to a default location,
2022-05-25T10:05:36,647         try rebuilding the ld cache with `sudo ldconfig`
2022-05-25T10:05:36,647         or specify zmq's location with `--zmq=/usr/local`

2022-05-25T10:05:36,648   You can skip all this detection/waiting nonsense if you know
2022-05-25T10:05:36,648   you want pyzmq to bundle libzmq as an extension by passing:

2022-05-25T10:05:36,648       `--zmq=bundled`

2022-05-25T10:05:36,648   I will now try to build libzmq as a Python extension
2022-05-25T10:05:36,648   unless you interrupt me (^C) in the next 10 seconds...

2022-05-25T10:05:36,649   ************************************************

2022-05-25T10:05:37,646   10...
2022-05-25T10:05:38,647    9...
2022-05-25T10:05:39,648    8...
2022-05-25T10:05:40,648    7...
2022-05-25T10:05:41,649    6...
2022-05-25T10:05:42,649    5...
2022-05-25T10:05:43,650    4...
2022-05-25T10:05:44,650    3...
2022-05-25T10:05:45,650    2...
2022-05-25T10:05:46,650    1...
2022-05-25T10:05:46,651   Using bundled libzmq
2022-05-25T10:05:46,652   already have bundled\zeromq
2022-05-25T10:05:46,652   staging platform.hpp from: C:\Users\mongoPy\AppData\Local\Temp\pip-install-_9xjmmbv\pyzmq_eac4bf46366d4c8c873024085d812e18\buildutils\include_win32
2022-05-25T10:05:46,662   error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
2022-05-25T10:05:46,663   ************************************************
2022-05-25T10:05:46,732   ERROR: Failed building wheel for pyzmq
2022-05-25T10:05:46,733   Running setup.py clean for pyzmq
2022-05-25T10:05:46,733   Running command 'C:\Users\mongoPy\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mongoPy\\AppData\\Local\\Temp\\pip-install-_9xjmmbv\\pyzmq_eac4bf46366d4c8c873024085d812e18\\setup.py'"'"'; __file__='"'"'C:\\Users\\mongoPy\\AppData\\Local\\Temp\\pip-install-_9xjmmbv\\pyzmq_eac4bf46366d4c8c873024085d812e18\\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'"'"'))' clean --all
2022-05-25T10:05:47,381   C:\Users\mongoPy\AppData\Local\Temp\pip-install-_9xjmmbv\pyzmq_eac4bf46366d4c8c873024085d812e18\setup.py:1130: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
2022-05-25T10:05:47,382     if V(Cython.__version__) < V(min_cython_version):
2022-05-25T10:05:47,886   running clean
2022-05-25T10:05:47,917   removing zmq\backend\cython\constants.c
2022-05-25T10:05:47,917   removing zmq\backend\cython\context.c
2022-05-25T10:05:47,917   removing zmq\backend\cython\error.c
2022-05-25T10:05:47,918   removing zmq\backend\cython\message.c
2022-05-25T10:05:47,918   removing zmq\backend\cython\socket.c
2022-05-25T10:05:47,918   removing zmq\backend\cython\utils.c
2022-05-25T10:05:47,918   removing zmq\backend\cython\_device.c
2022-05-25T10:05:47,918   removing zmq\backend\cython\_poll.c
2022-05-25T10:05:47,918   removing zmq\backend\cython\_proxy_steerable.c
2022-05-25T10:05:47,918   removing zmq\backend\cython\_version.c
2022-05-25T10:05:47,918   removing zmq\devices\monitoredqueue.c
2022-05-25T10:05:47,919   removing zmq\utils\compiler.json
2022-05-25T10:05:47,919   removing build/
2022-05-25T10:05:47,962 Failed to build bcrypt pyzmq
2022-05-25T10:05:47,963 ERROR: Could not build wheels for bcrypt which use PEP 517 and cannot be installed directly
2022-05-25T10:05:47,963 Exception information:
2022-05-25T10:05:47,963 Traceback (most recent call last):
2022-05-25T10:05:47,963   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 173, in _main
2022-05-25T10:05:47,963     status = self.run(options, args)
2022-05-25T10:05:47,963   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_internal\cli\req_command.py", line 203, in wrapper
2022-05-25T10:05:47,963     return func(self, options, args)
2022-05-25T10:05:47,963   File "C:\Users\mongoPy\anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 357, in run
2022-05-25T10:05:47,963     raise InstallationError(
2022-05-25T10:05:47,963 pip._internal.exceptions.InstallationError: Could not build wheels for bcrypt which use PEP 517 and cannot be installed directly
2022-05-25T10:05:47,975 Removed build tracker: 'C:\\Users\\mongoPy\\AppData\\Local\\Temp\\pip-req-tracker-_4pcgnpc'

I have managed to run this, recreated the mflix using Python 3.8 and it has resolved this issue

I have moved on but now I am getting another error. requirement.txt has been installed without any error but when I run run.py I get following error:
(mflix) C:\Education\MongoDb\PythonM220>python run.py
Traceback (most recent call last):
File “run.py”, line 1, in
from mflix.factory import create_app
ModuleNotFoundError: No module named ‘mflix’

Hi, [Solved] - Step by Step

Thanks for your reply but I have managed to install the requirement.txt after downgrading python to 3.8, which I have mentioned earlier. My problem now is :
when I run run.py I get following error:
(mflix) C:\Education\MongoDb\PythonM220>python run.py
Traceback (most recent call last):
File “run.py”, line 1, in
from mflix.factory import create_app
ModuleNotFoundError: No module named ‘mflix’

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.