question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setuptools.depends.get_module_constant doesn't work in Python 3.6?

See original GitHub issue
Python 3.6.0b4 (default, Nov 22 2016, 05:30:12) [MSC v.1900 64 bit (AMD64)] on win32 
Type "help", "copyright", "credits" or "license" for more information.               
>>> import setuptools             
>>> print(setuptools.__version__) 
30.1.0                            
>>> from setuptools.depends import get_module_constant                                                                   
>>> print(get_module_constant("setuptools", "__version__"))                                                              
Traceback (most recent call last):                                                                                       
  File "<stdin>", line 1, in <module>                                                                                    
  File "C:\dev\timesheet\dist\Windows_NT\python\lib\site-packages\setuptools\depends.py", line 164, in get_module_constant                                                                                                                        
    return extract_constant(code, symbol, default)                                                                       
  File "C:\dev\timesheet\dist\Windows_NT\python\lib\site-packages\setuptools\depends.py", line 195, in extract_constant  
    const = code.co_consts[arg]                                                                                          
IndexError: tuple index out of range                                                                                                                                                                       

I ask because I’m trying to use python-memcached which uses this get_module_constant and fails like that. Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
joristorkcommented, Aug 18, 2017

upgrading setuptools from v36.0.1 to v36.2.7 fixed it

0reactions
joristorkcommented, Aug 18, 2017

I get a similar crash under setuptools v36.0.1, python v3.6.2rc1, pip 9.0.1:

Collecting detectlanguage==1.2.1 (from -r requirements.txt (line 15))
  Using cached detectlanguage-1.2.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-c87dvbaa/detectlanguage/setup.py", line 9, in <module>
        version = get_module_constant('detectlanguage', '__version__'),
      File "/srv/chatbot/mentat/venv/lib/python3.6/site-packages/setuptools/depends.py", line 164, in get_module_constant
        return extract_constant(code, symbol, default)
      File "/srv/chatbot/mentat/venv/lib/python3.6/site-packages/setuptools/depends.py", line 195, in extract_constant
        const = code.co_consts[arg]
    IndexError: tuple index out of range
Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Can't Find SetupTools - - Stack Overflow
I'm using Python 3.6 and both pip and setuptools are installed and up-to date. I'm able to install other Python packages with no...
Read more >
2. Writing the Setup Script — Python 3.11.1 documentation
The setup script is the centre of all activity in building, distributing, and installing modules using the Distutils. The main purpose of the...
Read more >
How to Package Python dependencies with PIP setuptools
Learn step by step how to package a Python project with PIP ... This article provides a brief tutorial on how to work...
Read more >
Python packaging edge cases - 921Kiyo
TL;DR: You cannot package a Python module that depends on local wheel dependencies. Python packaging is one of those things that doesn't work...
Read more >
12. Creating packages — Level Up Your Python - GitHub Pages
If you want to actively develop a module, use this instead (setuptools only, command varies on other tools):. pip install -e . This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found