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

RuntimeWarning: Config variable 'Py_DEBUG' is unset #3383

Closed
DiegoQueiroz opened this issue Jan 20, 2016 · 27 comments
Closed

RuntimeWarning: Config variable 'Py_DEBUG' is unset #3383

DiegoQueiroz opened this issue Jan 20, 2016 · 27 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@DiegoQueiroz
Copy link

When I run pip (any argument) I get the following message:

c:\Program Files\Python34\Scripts>pip --version
c:\progra~1\python34\lib\site-packages\pip\pep425tags.py:89: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
c:\progra~1\python34\lib\site-packages\pip\pep425tags.py:93: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
pip 8.0.0 from c:\progra~1\python34\lib\site-packages (python 3.4)

I think something is wrong.

@DiegoQueiroz
Copy link
Author

Important to cite that I am running it on Windows, and I just upgraded to the 8.0.0 with pip install -U pip.

@rvandermeulen
Copy link

Also hitting this on Windows. Issue 3075 looks relevant.

@dstufft
Copy link
Member

dstufft commented Jan 20, 2016

Is it causing an error, or just printing spurious warnings?

@DiegoQueiroz
Copy link
Author

Just the warnings. It appear to be working as expected.

@dstufft
Copy link
Member

dstufft commented Jan 20, 2016

Okay, that much is good then! This will be because of the new, attempted emulation of SOABI support in pip 8.0. It may be need to adjusted for Windows.

@DiegoQueiroz
Copy link
Author

Great. I have no idea what is SOABI, so... 😅

@Ivoz
Copy link
Contributor

Ivoz commented Jan 20, 2016

Both Anaconda Python 3.4, & Python.org 3.5 x64 give this:

From sysconfig:
Py_DEBUG: None
WITH_PYMALLOC: None
Py_UNICODE_SIZE: None
From headers:
Error getting Py_DEBUG
WITH_PYMALLOC: 1
Error getting Py_UNICODE_SIZE

from this

import sysconfig
print('From sysconfig:')
for k in 'Py_DEBUG', 'WITH_PYMALLOC', 'Py_UNICODE_SIZE':
    try:
        print(k + ': ' + repr(sysconfig.get_config_var(k)))
    except:
        print('Error getting %s' % k)

print('From headers:')
h_file = sysconfig.get_config_h_filename()
conf_vars = sysconfig.parse_config_h(open(h_file))
for k in 'Py_DEBUG', 'WITH_PYMALLOC', 'Py_UNICODE_SIZE':
    try:
        print(k + ': ' + repr(conf_vars[k]))
    except:
        print('Error getting %s' % k)

@Ivoz
Copy link
Contributor

Ivoz commented Jan 20, 2016

@zooba do you know what would be the nicest way to find if a python is a debug build on Windows, and/or have any comments for the rest of this? pep425tags.get_abi_tag is the function trying to find this information

@dstufft dstufft added this to the 8.0.1 milestone Jan 20, 2016
@dstufft
Copy link
Member

dstufft commented Jan 20, 2016

I guess the main question is whether we can actually rely on those variables being defined or if we have to just treat undefined as a false. It appears that we're not going to be able to detect the difference between undefined and false and we should just remove the warning?

@xavfernandez
Copy link
Member

Maybe it could simply be switched to a debug log ?

@dstufft
Copy link
Member

dstufft commented Jan 20, 2016

That seems like a reasonable thing to do.

@dstufft
Copy link
Member

dstufft commented Jan 20, 2016

Could someone who is getting this try #3399 and see if the warnings are gone? If so, can you also run with -vvv and ensure they are back?

@zooba
Copy link
Contributor

zooba commented Jan 20, 2016

Py_DEBUG is never going to be in pyconfig.h on Windows as the header is static (no autoconf) and debug/no-debug is determined using the preprocessor at build.

sys.gettotalrefcount is protected by Py_REF_DEBUG, which is not guaranteed to always be set when Py_DEBUG is set. That said, distutils.command.build tests for it, so it's probably safe enough (or at least, there'll be twice as many bugs when it breaks...).

The most reliable check is probably going to be:

any(x[0] == '_d.pyd' for x in imp.get_suffixes())

The only issue with this is that the imp module is deprecated - Python 3.3 and later should really use:

'_d.pyd' in importlib.machinery.EXTENSION_SUFFIXES

@dstufft
Copy link
Member

dstufft commented Jan 20, 2016

@zooba That's the most reliable check, specifically on Windows right?

@zooba
Copy link
Contributor

zooba commented Jan 20, 2016

True, only on Windows. There is far less variation in ABI tags on Windows - with 3.5 we added a version-specific extension suffix, but the non-specific .pyd and _d.pyd will not be removed.

AIUI, pyconfig.h is going to be valid on other platforms because of the autoconf/make install approach. On Windows, you can (easily) get a debug build of the binaries installed alongside a release "build" of the stdlib and headers.

@dstufft
Copy link
Member

dstufft commented Jan 20, 2016

Okay. I just wanted to make sure I guarded that behind a If WINDOWS: check if needed. Thanks a lot!

@dstufft
Copy link
Member

dstufft commented Jan 20, 2016

Going to open this again to get the better detection that @zooba mentioned.

@dstufft dstufft reopened this Jan 20, 2016
blp added a commit to openvswitch/ovs that referenced this issue Jan 21, 2016
It is now required for the build.

Thanks to Alin Gabriel Serdean for helping figure out the correct
solution here.

This adds --diable-pip-version-check because upgrading pip (as
suggested by the error that this option suppresses) causes pip
to fail, which is in turn a bug in pip that manifests only on
Windows: pypa/pip#3383.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
@darkmorpher
Copy link

On Python 2.7:

c:\program files\python27\lib\site-packages\pip\pep425tags.py:89: RuntimeWarning: Config 
variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect warn=(impl == 'cp')):

c:\program files\python27\lib\site-packages\pip\pep425tags.py:93: RuntimeWarning: Config 
variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect warn=(impl == 'cp')):

c:\program files\python27\lib\site-packages\pip\pep425tags.py:99: RuntimeWarning: Config 
variable 'Py_UNICODE_SIZE' is unset, Python ABI tag may be incorrect sys.version_info
 < (3, 3))) \

@LeonJansen
Copy link

Same here with Python 2.7:

c:\Python27\lib\site-packages\pip-8.0.0-py2.7.egg\pip\pep425tags.py:89: RuntimeWarning: Config   variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect warn=(impl == 'cp')):
c:\Python27\lib\site-packages\pip-8.0.0-py2.7.egg\pip\pep425tags.py:93: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect warn=(impl == 'cp')):
c:\Python27\lib\site-packages\pip-8.0.0-py2.7.egg\pip\pep425tags.py:99: RuntimeWarning: Config variable 'Py_UNICODE_SIZE' is unset, Python ABI tag may be incorrect sys.version_info < (3, 3))) Requirement already up-to-date: pip in c:\python27\lib\site-packages\pip-8.0.0-py2.7.egg

@dstufft
Copy link
Member

dstufft commented Jan 21, 2016

Can you test with the latest develop branch?

@JelmerL
Copy link

JelmerL commented Jan 21, 2016

Same here with Python 3.5.1

c:\users\python\python35-32\lib\site-packages\pip\pep425tags.py:89: RuntimeWarning: Config
variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\users\python\python35-32\lib\site-packages\pip\pep425tags.py:93: RuntimeWarning: Config
variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
pip 8.0.0 from c:\python\python35-32\lib\site-packages (python 3.5)

@richasinha
Copy link

Same with Python 2.7

c:\python27\lib\site-packages\pip\pep425tags.py:89: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\python27\lib\site-packages\pip\pep425tags.py:93: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\python27\lib\site-packages\pip\pep425tags.py:99: RuntimeWarning: Config variable 'Py_UNICODE_SIZE' is unset, Python ABI tag may be incorrect
sys.version_info < (3, 3)))
Requirement already satisfied (use --upgrade to upgrade): cv2 in c:\python27\lib
\site-packages

@DiegoQueiroz
Copy link
Author

@dstufft. I just tested the development branch.

c:\Program Files\Python34\Scripts>pip install https://codeload.github.com/pypa/pip/zip/develop

(...)

c:\Program Files\Python34\Scripts>pip --version
pip 8.1.0.dev0 from c:\progra~1\python34\lib\site-packages (python 3.4)

So everything is fine under Windows (at least the warnings are hidden).

But this thread will be flooded until you release a new version, lol.

@dstufft
Copy link
Member

dstufft commented Jan 21, 2016

Going to kick this out of 8.0.1 since we silenced the warning and the better detection can come later.

@dstufft dstufft removed this from the 8.0.1 milestone Jan 21, 2016
@Ivoz Ivoz modified the milestones: 8.0.3, 8.1 Feb 14, 2016
@dstufft
Copy link
Member

dstufft commented Mar 3, 2016

Closing this in favor of #3535 and dropping from the 8.1 milestone.

@giampaolo
Copy link

This issue is currently affecting psutil Windows wheels: giampaolo/psutil#810 (comment)
I am not sure I understand the nature of the problem, whether it's pip or wheel package. Any advice?

@peterjc
Copy link

peterjc commented Jun 23, 2016

From reading the comments about, it sounds like this was fixed by silencing the warnings - but I'm seeing the warnings with pip 8.1.2 under Python 2.7 and 3.4 testing on 32 bit Windows XP (yes, it is old), e.g.

C:\repositories\biopython>c:\python34\scripts\pip --version
pip 8.1.2 from c:\python34\lib\site-packages (python 3.4)
C:\repositories\biopython>c:\python34\python setup.py bdist_wheel
...
writing manifest file 'biopython.egg-info\SOURCES.txt'
Copying biopython.egg-info to build\bdist.win32\wheel\.\biopython-1.67-py3.4.egg-info
running install_scripts
C:\Python34\lib\site-packages\wheel\pep425tags.py:77: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
C:\Python34\lib\site-packages\wheel\pep425tags.py:81: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
creating build\bdist.win32\wheel\biopython-1.67.dist-info\WHEEL

More notes on the test setup at http://lists.open-bio.org/pipermail/biopython-dev/2016-June/021446.html http://lists.open-bio.org/pipermail/biopython-dev/2016-June/021448.html http://lists.open-bio.org/pipermail/biopython-dev/2016-June/021449.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests