Главная » Error » How to Solve Error Message Building wheel for psycopg2 (setup

How to Solve Error Message Building wheel for psycopg2 (setup

Introduction

This article actually is another version of the other version available. That version is an article with the title of ‘How to Solve Error Message ERROR: Failed building wheel for psycopg2 when installing psycopg2 using pip command’ and it exist in this link. This article is just another version only with the different title. The other article is focusing on the error of ‘ERROR: Failed building wheel for psycopg2’. But this article, there is another general error of ‘error: subprocess-exited-with-error’. So, the following is part of the error :

Building wheel for psycopg2 (setup.py) … error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [22 lines of output] C:repositorydjangoenvlibpython3.9site-packagessetuptoolsconfigsetupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)

On the other hand, the following is the full length of the error message appear. The trigger is the installation of ‘psycopg2’ python library. Furthermore, the installation is using pip command in a device running using Microsoft Windows operating system :

(env) C:repositorydjangoenvbin>pip install psycopg2
Collecting psycopg2
Using cached psycopg2-2.9.3.tar.gz (380 kB)
Preparing metadata (setup.py) … done
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) … error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [22 lines of output] C:repositorydjangoenvlibpython3.9site-packagessetuptoolsconfigsetupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
running bdist_wheel
running build
running build_py
creating build
creating buildlib.mingw_x86_64-cpython-39
creating buildlib.mingw_x86_64-cpython-39psycopg2
copying liberrorcodes.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying liberrors.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libextensions.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libextras.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libpool.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libsql.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libtz.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying lib_ipaddress.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying lib_json.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying lib_range.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying lib__init__.py -> buildlib.mingw_x86_64-cpython-39psycopg2
running build_ext
building ‘psycopg2._psycopg’ extension
error: –plat-name must be one of (‘win32’, ‘win-amd64’, ‘win-arm32’, ‘win-arm64’)
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2 … error
error: subprocess-exited-with-error

× Running setup.py install for psycopg2 did not run successfully.
│ exit code: 1
╰─> [24 lines of output] C:repositorydjangoenvlibpython3.9site-packagessetuptoolsconfigsetupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
running install
C:repositorydjangoenvlibpython3.9site-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating buildlib.mingw_x86_64-cpython-39
creating buildlib.mingw_x86_64-cpython-39psycopg2
copying liberrorcodes.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying liberrors.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libextensions.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libextras.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libpool.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libsql.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying libtz.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying lib_ipaddress.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying lib_json.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying lib_range.py -> buildlib.mingw_x86_64-cpython-39psycopg2
copying lib__init__.py -> buildlib.mingw_x86_64-cpython-39psycopg2
running build_ext
building ‘psycopg2._psycopg’ extension
error: –plat-name must be one of (‘win32’, ‘win-amd64’, ‘win-arm32’, ‘win-arm64’)
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> psycopg2

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

(env) C:repositorydjangoenvbin>
(env) C:repositorydjangoenvbin>python -V
Python 3.9.10

(env) C:repositorydjangoenvbin>

Conclusion

Finally conclude, we can say that we have discussed various methods in this article to solve the ‘error: legacy-install-failure’ error which occurs for different libraries and modules. You can use any of the methods according to your requirements and according to the library or modules, you want to install for your program.

Я не могу понять что нужно сделать чтобы не было этой ошыбки?

  • 1 подписчик
  • 12 часов назад
  • 48 просмотров

ответа
4

  • python
    • Python

    Простой

  • FAQs on Error: legacy-install-failure

    How can you solve ‘error: legacy-install-failure’?

    There are many ways you can solve this error, and we have discussed some of them in this article. You can follow those solutions to solve this error depending upon the library you want to install.

    How to upgrade setuptools with pip?

    You can upgrade setuptool with pip using the following command:
    pip install – upgrade setuptools

    Can you pip install pandas?

    You can pip install pandas from PyPI.

    Как получить response?

    • 1 подписчик
    • 10 часов назад
    • 80 просмотров

    ответа
    4

  • python
    • Python

    • +1 ещё

    Простой

  • Как заставить дискорд бота запустить песню?

    • 2 подписчика
    • 12 часов назад
    • 31 просмотр

    ответ
    1

  • python
    • Python

    • +1 ещё

    Простой

  • Как сделать /unmute aiogram?

    • 1 подписчик
    • 12 часов назад
    • 40 просмотров

    ответов
    0

  • python
    • Python

    Простой

  • Solve error: legacy-install-failure For Horovod

    When you are trying to install ‘horvord’ with ‘PyTorch,’ you might encounter an error of sort ‘error: legacy-install-failure’.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: legacy-install-failure

    × Encountered error while trying to install package.
    ╰─> horovod

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for output from the failure.

    This error occurs because an older version of ‘horovord’ than 0.24.0 is not compatible with PyTorch. Therefore you can solve this error by upgrading ‘horovord’ to newer versions.

    The A-Z of Make Requirements.txt in Python
    The A-Z of Make Requirements.txt in Python
    Trending The A-Z of Make Requirements.txt in Python

    Solve error: legacy-install-failure For Dlib

    You can also get an error while installing the ‘dlib’ library through pip. To solve this error, try to install the library from scratch by following the steps.

    • First, install ‘anaconda.’
    • Further activate the virtual environment through a command prompt.
    • Install ‘opencv’ using pip.
    • Install ‘dlib’ using pip.

    This will eventually solve your error.

    Solve error: legacy-install-failure For Basemap

    Basemap is a tool in python that provides you to create maps in a very easy and simple way. It is an extension of the ‘ matplotlib ‘ library; therefore, it contains all the features for carrying out data visualization. It further adds geographical projections and some other additional data sets in order to enable plotting coastlines, countries, states, boundaries and etc., directly from the library. Similarly, when you try to install this library through ‘pip,’ you might face a Solve ‘ error: legacy-install-failure’. We will discuss how we can solve this error for the basemap library.

    Solving For Windows Operating System

    If you are using Windows operating system and encounter this error you need to follow some steps. The steps are as given below:

    • First, go this path https://www.lfd.uci.edu/~gohlke/pythonlibs/#basemap
    • You will be directed to the file directory. If you’re using python 3.10.x, download the file named ‘basemap‑1.3.2‑cp310‑cp310‑win_amd64.whl‘
    • Now go to this wheel file and run the following command:

    pip install basemap‑1.3.2‑cp310‑cp310‑win_amd64.whl

    Doing this should solve the ‘error: legacy-install-failure’ error.

    Solving For MAC Operating System

    If you are using MAC Operating System and encounter this error, you need to follow some steps. The steps are as given below:

    • First, make sure you install all the packages as shown below:

    brew install geos
    brew install matplotlib
    brew install numpy
    brew install proj

    • Then you have to add GEOS_DIR = “/ user / local / Cellar / geos / 3.10.2 /” to your .bash profile and reload it via: source ~/.bash_profile. You can do that by :

    git clone –depth 1 https://github.com/matplotlib/basemap.git

    • Further, go to the basemap directory from the path: basemap/packages/ basemap. And finally, run the install code from that directory.

    pip3 install

    This should solve the ‘error: legacy-install-failure’ error.

    Solving For Google Colab

    To solve this error in google colab, you need to run the commands given below, and doing that should solve the ‘error: legacy-install-failure’ error.

    !sudo apt-get install libgeos-3.6.2
    !sudo apt-get install libgeos-dev
    !pip install git+https://github.com/matplotlib/basemap#subdirectory=packages/basemap
    Trending: Generate OpenSSL Symmetric Key Using Python

    Solution 2

    You have to install the python 3.9.10 version from python.org and after installtion upgrade your pip and everything will be sort .It is the problem in python 3.10.2 …This method is working ,i was suffering from same problem in installing the turtle so i did that and error was solved.

    Original Author Faixan ul islam Of This Content

    Как очистить форму после ввода в Django?

    • 1 подписчик
    • 11 часов назад
    • 19 просмотров

    ответов
    0

  • python
    • Python

    • +1 ещё

    Простой

  • Как перейти по ярлыку?

    • 1 подписчик
    • 5 часов назад
    • 34 просмотра

    ответа
    2

  • python
    • Python

    Простой

  • Solve error: legacy-install-failure In Pandas

    Pandas is an open-source library in python which allows users to perform high-level data manipulation. It is one of the most important libraries in python in the sense of data structure programming and data analysis because it provides flexible, fast and expressive data structures. However, sometimes when you try to install this library using pip, you can get an ‘error: legacy-install-failure,’ which can prevent us from using this very important library. Let us see how we can solve this error in python.

    To solve this problem, you need to install ‘pipwin’ because it may happen that the ‘pandas’ wheel might not support the python version you are working on; therefore, first, install ‘pipwin’.

    pip install pipwin

    And further, when you install ‘pipwin,’ install ‘pandas’ using ‘pipwin.’

    pipwin install pandas

    This should probably solve the ‘error: legacy-install-failure’ and allow you to install the pandas library and use it.

    Как сделать повторение кода Python в exe?

    • 1 подписчик
    • 9 часов назад
    • 50 просмотров

    ответ
    1

  • python
    • Python

    • +1 ещё

    Простой

  • Solve Error legacy-install-failure For Cffi

    When you are programming on Django, you might get an error while installing libraries. You can solve this error by the following code.

    RUN python -m venv /py &&
    /py/bin/pip install –upgrade pip &&
    apk add –update alpine-sdk &&
    apk add –update –no-cache postgresql-client &&
    apk add –update –no-cache –virtual .tmp-build-deps
    build-base gcc python3-dev postgresql-dev musl-dev libffi-dev openssl-dev cargo &&
    /py/bin/pip install -r /tmp/requirements.txt &&
    if [ $DEV = “true” ];
    then /py/bin/pip install -r /tmp/requirements.dev.txt ;
    fi &&
    rm -rf /tmp &&
    apk del .tmp-build-deps &&
    adduser
    –disabled-password
    –no-create-home
    django-user
    Popular now Gingerit: Correct Grammatical Errors Using Python

    Как ему обозначить переменную?

    • 1 подписчик
    • 12 часов назад
    • 47 просмотров

    ответов
    0

  • Показать ещёЗагружается…
  • Вакансии с Хабр Карьеры

    Системный администратор Windows

    Gaijin
    •Ереван
    от 1 400 €

    Системный инженер Windows

    Золотое Яблоко
    •Екатеринбург
    от 100 000 ₽

    Python разработчик

    Сбер
    •Иннополис
    от 80 000 ₽
    Ещё вакансии

    Заказы с Хабр Фриланса

    Заглушка сайта

    18 окт. 2022, в 10:52
    3000 руб./за проект

    Постоянные задачи по Битрикс24

    18 окт. 2022, в 10:48
    500 руб./в час

    Доработать сайт

    18 окт. 2022, в 10:46
    4000 руб./за проект
    Ещё заказы

    Минуточку внимания

    Присоединяйтесь к сообществу, чтобы узнавать новое и делиться знаниями

    Зарегистрироваться

    Самое интересное за 24 часа

    • Какие есть сервисы кэширования для сайта?

      • 6 подписчиков
      • 0 ответов
    • Как скачивать с защищенных каналов Telegram?

      • 7 подписчиков
      • 1 ответ
    • Почему отключается видеокарта?

      • 2 подписчика
      • 0 ответов
    • Как сделать блок, пропорциональный своей ВЫСОТЕ?

      • 4 подписчика
      • 1 ответ
    • Имеет ли смысл такая оптимизация?

      • 4 подписчика
      • 2 ответа
    • Откуда папка Linux на windows 11?

      • 3 подписчика
      • 1 ответ
    • Как в Kafka или других очередях сообщений гарантируется порядок сообщений?

      • 3 подписчика
      • 0 ответов
    • Как сохранить вывод терминала в переменную?

      • 3 подписчика
      • 1 ответ
    • В чем проблема при валидации JWT токена?

      • 2 подписчика
      • 1 ответ
    • Автовоспроизведение видео послезагрузки страницы?

      • 3 подписчика
      • 1 ответ
    • © Habr
    • О сервисе
    • Обратная связь
    • Блог

    Solve error: legacy-install-failure For MySQL

    MySQL provides services for handling and managing databases. When you connect your python application to an active server, you can manage all your database using MySQL. Although when installing using an ‘Error: legacy-install-failure’ error might occur. It can display something like this.

    note: This error originates from a subprocess, and is likely not a problem with
    pip.
    error: legacy-install-failure

    × Encountered error while trying to install package.
    ╰─> mysqlclient

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for output from the failure.

    To solve this following error, you will need to follow the steps given below:

    • First, run the commands given below

    xcode-select –install
    brew install zstd
    pip install pymysql
    pip install wheel
    CFLAGS=”-I$(brew –prefix)/include” LDFLAGS=”-L$(brew –prefix)/lib” pip install mysqlclient==

    • Further, make some changes in the settings file if you are using some framework like Django or any other. To make this change run these commands.

    import pymysql
    pymysql.install_as_MySQLdb()

    Further, install all other dependencies in the env/lib/python3.8/site-packages/django/db/backends/mysql/base.py directory. These dependencies can be installed like:

    pip install mysql-connector-python
    pip install cryptography

    • Now try to install MySQL again, as following these steps should solve the error.

    Как завершить выполнение кода принудительно?

    • 1 подписчик
    • 8 часов назад
    • 86 просмотров

    ответ
    1

  • python
    • Python

    Простой

  • Возможно ли запустить ChromeDriver в headless режиме с расширениями?

    • 2 подписчика
    • 12 часов назад
    • 29 просмотров

    ответов
    0

  • python
    • Python

    • +2 ещё

    Простой

  • Solve Error legacy-install-failure For Fbprophet

    You can encounter an error while installing Facebook prophet using pip. This error occurs because you might not have installed dependencies for the wheel to be installed. You can solve this error by installing all the dependencies and then installing the ‘fbprophet’ using pip.

    Solve error: legacy-install-failure For Psycopg2-binary

    To solve this error, you have to follow some steps. You can solve this problem by upgrading some packages.

    pip uninstall psycopg2
    pip list –outdated
    pip install –upgrade wheel
    pip install –upgrade setuptools
    pip install psycopg2

    This code will upgrade some outdated packages and might solve the problem.

    Источники

    • https://www.dark-hamster.com/application/how-to-solve-error-message-building-wheel-for-psycopg2-setup-py-error-error-subprocess-exited-with-error-when-installing-psycopg2-using-pip-command-in-microsoft-windows/
    • https://www.pythonpool.com/error-legacy-install-failure/
    • https://qna.habr.com/q/1111454
    • https://ittutorialpoint.com/note-this-error-originates-from-a-subprocess-and-is-likely-not-a-problem-with-pip/
    [свернуть]
    Решите Вашу проблему!


    ×
    Adblock
    detector