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

setup.py failure on Python 3 #3385

Closed
takluyver opened this issue May 30, 2013 · 6 comments
Closed

setup.py failure on Python 3 #3385

takluyver opened this issue May 30, 2013 · 6 comments

Comments

@takluyver
Copy link
Member

#3340 causes more of the codebase to be imported from setup.py. Anything that's imported at that stage must be valid Python 3 syntax, because 2to3 hasn't run at that point.

Specifically, it now tries to load IPython.utils.path, which pulls in the config system, more of utils, pexpect, etc. and IPython.frontend.html.notebook, which is probably going to bring in most of the rest of the codebase.

Unless we're going to bite the bullet and do a full source port straight away, we need a better way to determine whether setup.py is running for a package manager.

Traceback (most recent call last):
  File "setup.py", line 145, in <module>
    require_clean_submodules()
  File "setup.py", line 129, in require_clean_submodules
    status = check_submodule_status(here)
  File "IPython/utils/submodule.py", line 64, in check_submodule_status
    if is_package():
  File "IPython/utils/submodule.py", line 46, in is_package
    from IPython.utils.path import get_ipython_package_dir
  File "/home/slave/jenkins/workspace/ipython-multi/91fd20c6/IPython/__init__.py", line 43, in <module>
    from .config.loader import Config
  File "/home/slave/jenkins/workspace/ipython-multi/91fd20c6/IPython/config/__init__.py", line 16, in <module>
    from .application import *
  File "/home/slave/jenkins/workspace/ipython-multi/91fd20c6/IPython/config/application.py", line 283
    print os.linesep.join(lines)
           ^
SyntaxError: invalid syntax
@takluyver
Copy link
Member Author

Note: this showed up on Travis as an 'error', not a failure. We need to remember to pay attention to those: if Travis gives anything but a green light, we need to at least briefly look into it.

@pleabargain
Copy link

Getting a slightly diff. error but python3 install is failing:
python3 setup.py install

Traceback (most recent call last):
  File "setup.py", line 145, in <module>
    require_clean_submodules()
  File "setup.py", line 129, in require_clean_submodules
    status = check_submodule_status(here)
  File "IPython/utils/submodule.py", line 64, in check_submodule_status
    if is_package():
  File "IPython/utils/submodule.py", line 46, in is_package
    from IPython.utils.path import get_ipython_package_dir
  File "/usr/local/src/ipython/IPython/__init__.py", line 43, in <module>
    from .config.loader import Config
  File "/usr/local/src/ipython/IPython/config/__init__.py", line 16, in <module>
    from .application import *
  File "/usr/local/src/ipython/IPython/config/application.py", line 124
    name = Unicode(u'application')
                                ^
SyntaxError: invalid syntax

@takluyver
Copy link
Member Author

The difference in the error is just down to the Python version - the error I pasted is from 3.3, yours is from 3.2 (or potentially even an earlier version).

@pleabargain
Copy link

python3 --version
Python 3.2.3

@parinyahi
Copy link

Got this error during installation

"C:\Python27>python D:\ipython-2.1.0\setup.py install

Traceback (most recent call last):
File "D:\ipython-2.1.0\setup.py", line 56, in
from setupbase import target_update
File "D:\ipython-2.1.0\setupbase.py", line 504, in
execfile(pjoin('IPython','utils','submodule.py'), globals())
IOError: [Errno 2] No such file or directory: 'IPython\utils\submodule.py'"

@takluyver
Copy link
Member Author

@parinyahi that's a different issue, so please file it separately, or use the chat room or email list to ask about it. It looks like setup.py assumes it's running from the working directory. I don't know if we'd be interested in changing that or not.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants