OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Error Installing psycopg2-binary from requirements.txt [duplicate]

  • Thread starter Thread starter anas
  • Start date Start date
A

anas

Guest
I'm currently trying to install the psycopg2-binary library from a requirements.txt file, but I'm encountering a build error. Despite having PostgreSQL and pgAdmin installed on my local machine, the installation fails when trying to build the wheel for psycopg2-binary. Here's the relevant part of my requirements.txt:

Code:
psycopg2-binary==2.9.1

And here is the error message I received during installation:

Code:
Collecting psycopg2-binary==2.9.1 (from -r requirements.txt (line 6))
  Using cached psycopg2-binary-2.9.1.tar.gz (380 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: psycopg2-binary
  Building wheel for psycopg2-binary (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for psycopg2-binary (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-312
      creating build\lib.win-amd64-cpython-312\psycopg2
      copying lib\errorcodes.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\errors.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\extensions.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\extras.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\pool.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\sql.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\tz.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\_ipaddress.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\_json.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\_range.py -> build\lib.win-amd64-cpython-312\psycopg2
      copying lib\__init__.py -> build\lib.win-amd64-cpython-312\psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      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/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psycopg2-binary
Failed to build psycopg2-binary
ERROR: Could not build wheels for psycopg2-binary, which is required to install pyproject.toml-based projects

The error specifically states that Microsoft Visual C++ 14.0 or greater is required. I'm not sure how to proceed with this requirement or if there's an alternative way to successfully install this package without encountering this error.

Has anyone faced a similar issue or can provide guidance on how to resolve this? Any help would be greatly appreciated!
<p>I'm currently trying to install the <code>psycopg2-binary</code> library from a <code>requirements.txt</code> file, but I'm encountering a build error. Despite having PostgreSQL and pgAdmin installed on my local machine, the installation fails when trying to build the wheel for <code>psycopg2-binary</code>. Here's the relevant part of my <code>requirements.txt</code>:</p>
<pre><code>psycopg2-binary==2.9.1
</code></pre>
<p>And here is the error message I received during installation:</p>
<pre><code>Collecting psycopg2-binary==2.9.1 (from -r requirements.txt (line 6))
Using cached psycopg2-binary-2.9.1.tar.gz (380 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: psycopg2-binary
Building wheel for psycopg2-binary (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for psycopg2-binary (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-312
creating build\lib.win-amd64-cpython-312\psycopg2
copying lib\errorcodes.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\errors.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\extensions.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\extras.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\pool.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\sql.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\tz.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\_ipaddress.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\_json.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\_range.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\__init__.py -> build\lib.win-amd64-cpython-312\psycopg2
running build_ext
building 'psycopg2._psycopg' extension
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/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psycopg2-binary
Failed to build psycopg2-binary
ERROR: Could not build wheels for psycopg2-binary, which is required to install pyproject.toml-based projects
</code></pre>
<p>The error specifically states that Microsoft Visual C++ 14.0 or greater is required. I'm not sure how to proceed with this requirement or if there's an alternative way to successfully install this package without encountering this error.</p>
<p>Has anyone faced a similar issue or can provide guidance on how to resolve this? Any help would be greatly appreciated!</p>
 

Latest posts

H
Replies
0
Views
1
hohohohoho
H
Top