Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install python 3.8 windows 10 #990

Closed
tolstislon opened this issue Oct 18, 2019 · 18 comments
Closed

Unable to install python 3.8 windows 10 #990

tolstislon opened this issue Oct 18, 2019 · 18 comments
Labels

Comments

@tolstislon
Copy link

tolstislon commented Oct 18, 2019

Windows 10 Python 3.8

(untitled1) D:\python_other\untitled1>pip install psycopg2-binary
Collecting psycopg2-binary
  Using cached https://files.pythonhosted.org/packages/80/91/91911be01869fa877135946f928ed0004e62044bdd876c1e0f12e1b5fb90/psycopg2-binary-2.8.3.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\user\.virtualenvs\untitled1-lq2ited9\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-ins
tall-9839um0z\\psycopg2-binary\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-9839um0z\\psycopg2-binary\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"
'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\user\AppData\Local\Temp\
pip-install-9839um0z\psycopg2-binary\pip-egg-info'
         cwd: C:\Users\user\AppData\Local\Temp\pip-install-9839um0z\psycopg2-binary\
    Complete output (23 lines):
    running egg_info
    creating C:\Users\user\AppData\Local\Temp\pip-install-9839um0z\psycopg2-binary\pip-egg-info\psycopg2_binary.egg-info
    writing C:\Users\user\AppData\Local\Temp\pip-install-9839um0z\psycopg2-binary\pip-egg-info\psycopg2_binary.egg-info\PKG-INFO
    writing dependency_links to C:\Users\user\AppData\Local\Temp\pip-install-9839um0z\psycopg2-binary\pip-egg-info\psycopg2_binary.egg-info\dependency_links.txt
    writing top-level names to C:\Users\user\AppData\Local\Temp\pip-install-9839um0z\psycopg2-binary\pip-egg-info\psycopg2_binary.egg-info\top_level.txt
    writing manifest file 'C:\Users\user\AppData\Local\Temp\pip-install-9839um0z\psycopg2-binary\pip-egg-info\psycopg2_binary.egg-info\SOURCES.txt'
    
    Error: pg_config executable not found.
    
    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:
    
        python setup.py build_ext --pg-config /path/to/pg_config build ...
    
    or with the pg_config option in 'setup.cfg'.
    
    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.
    
    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Windows 10 python 3.7 - Good

@dvarrazzo
Copy link
Member

I know

@dvarrazzo
Copy link
Member

dvarrazzo commented Oct 19, 2019

Appveyor doesn't support Python 3.8 yet.

https://www.appveyor.com/docs/windows-images-software/#python

Support for Python 3.8 on Windows will be added when appveyor will add it.

@heckad
Copy link

heckad commented Oct 24, 2019

When does Appveyor usually add a new version of python?

@FrankyBoy
Copy link

So ... what do you need to fix this?

@dvarrazzo
Copy link
Member

dvarrazzo commented Nov 8, 2019

@FrankyBoy That either appveyor makes 3.8 available on their machine, or that someone contributes a patch to the appveyor.py script to install it ourselves.

@FrankyBoy
Copy link

Hi! Sorry for potentially stupid questions, new to python and appveyor (mainly did c# on gitlab-ci lately). Regarding that script you mentioned, am I correct that this would be some solution akin to this here: installing pypy on appveyor? Also, if I adapt the script, how can I actually test it before making a PR?

@jamadden
Copy link

jamadden commented Nov 9, 2019

Python 3.8 is now available on AppVeyor (appveyor/ci#3142). (Where, incidentally, I have the same issue as #1006)

jamadden added a commit to zodb/relstorage that referenced this issue Nov 9, 2019
We need binary wheels for psycopg2. See psycopg/psycopg2#990
jamadden added a commit to zodb/relstorage that referenced this issue Nov 9, 2019
We need binary wheels for psycopg2. See psycopg/psycopg2#990
@dvarrazzo
Copy link
Member

Packages released.

https://pypi.org/project/psycopg2/2.8.4/#files

@hingston
Copy link

pip uninstall psycopg2-binary
pip install psycopg2-binary --no-cache-dir

@Kylotan
Copy link

Kylotan commented Nov 17, 2019

It's not clear whether this is closed because it's believed the problem is fixed, but... it's not. Trying to install either psycopg2 or psycopg2-binary on Windows via Pip will error out with a message saying "Error: pg_config executable not found."

@jerickso
Copy link
Member

@Kylotan, the problem is fixed. My guess is you are inadvertently reinstalling the cached version of the previous package. @hingston provided the correct steps by adding the parameter:
--no-cache-dir
onto the pip command line.

You can verify pip is using a cache file if it displaying the following after running the pip install command:

C:\Python38\Scripts>pip install psycopg2-binary
Collecting psycopg2-binary
  Using cached <url>

@sckol
Copy link

sckol commented Nov 18, 2019

For me also doesn't work. For a fresh Python 3.8 installation I have:

pip install psycopg2-binary --no-cache-dir
Collecting psycopg2-binary
  Downloading https://files.pythonhosted.org/packages/00/7b/a623f49b3248957e7eaaac52eba1117209775d54e7a8501c460473a7ba4f/psycopg2-binary-2.8.4.tar.gz (378kB)
    100% |████████████████████████████████| 378kB 2.6MB/s
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info\psycopg2_binary.egg-info
    writing pip-egg-info\psycopg2_binary.egg-info\PKG-INFO
    writing dependency_links to pip-egg-info\psycopg2_binary.egg-info\dependency_links.txt
    writing top-level names to pip-egg-info\psycopg2_binary.egg-info\top_level.txt
    writing manifest file 'pip-egg-info\psycopg2_binary.egg-info\SOURCES.txt'

    Error: pg_config executable not found.

@Kylotan
Copy link

Kylotan commented Nov 18, 2019

Nope, sorry.

Microsoft Windows [Version 10.0.17763.864]
(c) 2018 Microsoft Corporation. All rights reserved.

(venv) E:\code\pyprojects\MusicNewsSite>pip install psycopg2-binary --no-cache-dir
Collecting psycopg2-binary
  Downloading https://files.pythonhosted.org/packages/00/7b/a623f49b3248957e7eaaac52eba1117209775d54e7a8501c460473a7ba4f/psycopg2-binary-2.8.4.tar.gz (378kB)
    100% |████████████████████████████████| 378kB 7.3MB/s
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info\psycopg2_binary.egg-info
    writing pip-egg-info\psycopg2_binary.egg-info\PKG-INFO
    writing dependency_links to pip-egg-info\psycopg2_binary.egg-info\dependency_links.txt
    writing top-level names to pip-egg-info\psycopg2_binary.egg-info\top_level.txt
    writing manifest file 'pip-egg-info\psycopg2_binary.egg-info\SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).


    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Ben\AppData\Local\Temp\pip-install-cc5xb110\psycopg2-binary\

@dvarrazzo
Copy link
Member

As far as I can see psycopg2-2.8.4-cp38-cp38-win_amd64.whl is there, at https://pypi.org/project/psycopg2/#files
Please someone debug why pip decides not to pick it up, thank you.

@jerickso
Copy link
Member

It works for me with both 32bit and 64bit binaries from Python.org, so there is something with your setup that is forcing it to download the source file package instead of the binary package.

One could try the following pip switch to force not use source packages, tho it doesn't explain why it is attempting to download the sources, and I half way expect this not to work, tho hopeful the error message may explain more of what is going on:
--only-binary :all:

If the above doesn't work, issue the following command and copy the output:
pip debug psycopg2-binary --verbose

For reference, here is what I get when using Python 3.8 (x64) installed from python.org:

c:\bin\Python38\Scripts>pip install psycopg2-binary --no-cache-dir
Collecting psycopg2-binary
  Downloading https://files.pythonhosted.org/packages/d4/1e/28aed558a39b8e98b4861d97c5326eb6ef0d4eaa13819607a60a34ea6143/psycopg2_binary-2.8.4-cp38-cp38-win_amd64.whl (1.1MB)
     |████████████████████████████████| 1.1MB 1.3MB/s
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.4

Even using venv it works as expected:

H:\prj\python>C:\bin\Python38\python -m venv test

H:\prj\python>test\Scripts\activate

(test) H:\prj\python>pip list
Package    Version
---------- -------
pip        19.2.3
setuptools 41.2.0
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

(test) H:\prj\python>pip install psycopg2-binary --no-cache-dir
Collecting psycopg2-binary
  Downloading https://files.pythonhosted.org/packages/d4/1e/28aed558a39b8e98b4861d97c5326eb6ef0d4eaa13819607a60a34ea6143/psycopg2_binary-2.8.4-cp38-cp38-win_amd64.whl (1.1MB)
     |████████████████████████████████| 1.1MB 1.3MB/s
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.4
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

(test) H:\prj\python>

@Kylotan
Copy link

Kylotan commented Nov 18, 2019

Okay, so what I was finding is that pip version 19.0.3 would always fail. I've upgraded pip to 19.3.1, and now it installs the wheel. No idea why this is different, and I couldn't see any bug fixes in the pip release notes that seem relevant.

@jerickso
Copy link
Member

Hmm, do you by chance know how you had version 19.0.3 installed? With a fresh installation of Python 3.8 in Windows for me, I have version 19.2.3 on both the 32 and 64 bits. Python 3.7 for me does has pip version 19.0.3, tho.

@kvanzuijlen
Copy link

kvanzuijlen commented Dec 24, 2019

This is the output of --verbose:

    Skipping link https://files.pythonhosted.org/packages/d4/1e/28aed558a39b8e98b4861d97c5326eb6ef0d4eaa13819607a60a34ea6143/psycopg2_binary-2.8.4-cp38-cp38-win_amd64.whl#sha256=b8f490f5fad1767a1331df1259763b3b
ad7d7af12a75b950c2843ba319b2415f (from https://pypi.org/simple/psycopg2-binary/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*); it is not compatible with this Python

So somehow, pip doesn't recognize that Python 3.8.1 should be compatible?

Edit: Sorry, it seems my venv + pip + python was somehow corrupted and used a mix of different versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants