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

Windows Python 2.7 build issues with pip #2959

Open
jakirkham opened this issue Jun 11, 2018 · 20 comments
Open

Windows Python 2.7 build issues with pip #2959

jakirkham opened this issue Jun 11, 2018 · 20 comments
Assignees

Comments

@jakirkham
Copy link
Member

Seeing a build issue with Sphinx on Windows Python 2.7, but not Python 3 or on other platforms with either Python. Appears some file is missing only on this platform and Python version. Not really sure what is going on.

cc @chohner

Actual Behavior

> python -m pip install --no-deps --ignore-installed . 
Processing c:\bld\sphinx_1527592727519\work
Exception:
Traceback (most recent call last):
  File "C:\bld\sphinx_1527592727519\_h_env\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\bld\sphinx_1527592727519\_h_env\lib\site-packages\pip\commands\install.py", line 335, in run
    wb.build(autobuilding=True)
  File "C:\bld\sphinx_1527592727519\_h_env\lib\site-packages\pip\wheel.py", line 756, in build
    self.requirement_set.prepare_files(self.finder)
  File "C:\bld\sphinx_1527592727519\_h_env\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\bld\sphinx_1527592727519\_h_env\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "C:\bld\sphinx_1527592727519\_h_env\lib\site-packages\pip\download.py", line 809, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "C:\bld\sphinx_1527592727519\_h_env\lib\site-packages\pip\download.py", line 686, in unpack_file_url
    shutil.copytree(link_path, location, symlinks=True)
  File "C:\bld\sphinx_1527592727519\_h_env\lib\shutil.py", line 222, in copytree
    raise Error, errors
Error: [('C:\\bld\\sphinx_1527592727519\\work\\tests\\roots\\test-images\\testima\xa8ge.png', 'c:\\users\\appveyor\\appdata\\local\\temp\\1\\pip-bjlv99-build\\tests\\roots\\test-images\\testima\xa8ge.png', "[Errno 2] No such file or directory: 'C:\\\\bld\\\\sphinx_1527592727519\\\\work\\\\tests\\\\roots\\\\test-images\\\\testima\\xa8ge.png'")]

ref: https://ci.appveyor.com/project/conda-forge/sphinx-feedstock/build/1.0.99/job/0ieygt5nuioessp9

Expected Behavior

Nothing is missing from the source tree.

Steps to Reproduce

PR ( conda-forge/sphinx-feedstock#35 )

Output of conda info
     active environment : base
    active env location : C:\Miniconda36-x64
            shell level : 1
       user config file : C:\Users\appveyor\.condarc
 populated config files : C:\Users\appveyor\.condarc
          conda version : 4.5.4
    conda-build version : 3.10.5
         python version : 3.6.5.final.0
       base environment : C:\Miniconda36-x64  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/win-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Miniconda36-x64\pkgs
                          C:\Users\appveyor\AppData\Local\conda\conda\pkgs
       envs directories : C:\Miniconda36-x64\envs
                          C:\Users\appveyor\AppData\Local\conda\conda\envs
                          C:\Users\appveyor\.conda\envs
               platform : win-64
             user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Windows/2012ServerR2 Windows/6.3.9600
          administrator : True
             netrc file : None
           offline mode : False
@jakirkham
Copy link
Member Author

FWIW this issue doesn't appear to occur with conda-build 2.

xref: conda-forge/sphinx-feedstock#36
ref: https://ci.appveyor.com/project/conda-forge/sphinx-feedstock/build/1.0.102/job/7fyc3iswfkk9f024

@nehaljwani
Copy link
Contributor

nehaljwani commented Jun 12, 2018

xref: AnacondaRecipes/sphinx-feedstock@4b9be32

IIRC, I had seen this too, and we just moved back from pip to using setuptools and it worked.

@jjhelmus
Copy link
Contributor

IIRC pip creates some rather long directories which have a tendency to hit the Windows path length limit, python setup.py install ... is a bit more forgiving with the path length.

@jakirkham
Copy link
Member Author

cc @isuruf @ocefpaf (for awareness)

@jakirkham
Copy link
Member Author

Though it does seem interesting that using pip with conda-build 2 does not run into the issue. Any idea what the difference is?

@jakirkham
Copy link
Member Author

Do you know if there is pip flag to affect the path length?

@ocefpaf
Copy link
Contributor

ocefpaf commented Jun 15, 2018

Looks like a pip bug IMO. @jjhelmus did you raise this upstream? Do you want me to do it?

@isuruf
Copy link
Contributor

isuruf commented Jun 15, 2018

It's not the path length. Filename has non-ASCII characters and you have to be careful with python 2.7.

@jakirkham
Copy link
Member Author

Where are the non-ASCII characters?

@isuruf
Copy link
Contributor

isuruf commented Jun 16, 2018

\xa8 in testima\xa8ge.png

@jakirkham
Copy link
Member Author

Sorry saw a \ on Windows and just thought it was part of the path. Thanks for clarifying that.

@jakirkham
Copy link
Member Author

This PR ( pypa/pip#4486 ) looks promising. It landed in pip version 10.0.0. We could backport it or we could try upgrading. The latter means we need to try disabling build isolation ( pypa/pip#5033 ). There should be an option to do this, but IDK if anyone has explored it.

@jakirkham
Copy link
Member Author

Tried a few things in PR ( conda-forge/sphinx-feedstock#38 ), but nothing seems to work. 😞

@jakirkham
Copy link
Member Author

Seeing this again with python-libarchive-c. Same story as before. Only happens on Windows Python 2.7.

xref: conda-forge/python-libarchive-c-feedstock#8

cc @marscher

@jakirkham jakirkham changed the title Build issue with Sphinx on Windows Python 2.7 Windows Python 2.7 build issues with pip Oct 27, 2018
@mingwandroid
Copy link
Contributor

File is: Sphinx-1.7.5/tests/roots/test-images/testimäge.png, looks like some unicode thing.

@mingwandroid mingwandroid self-assigned this Oct 27, 2018
@mingwandroid
Copy link
Contributor

While not suggesting it's not important to fix this, why is python 2 being used in the base environment anyway? I've never (except when looking into a bug) run conda-build under python 2. I don't see any reason to do that.

@isuruf
Copy link
Contributor

isuruf commented Oct 28, 2018

Base environment is python 3.6

@jakirkham
Copy link
Member Author

Correct. Only the build is using Python 2.

There is probably some special combination of Windows, encodings, and legacy unresolved Python issues.

IME switching to setuptools instead of pip usually fixes this issue (as it does with python-libarchive-c). So it may be something wrong with pip itself. Or it could be pip is using part of the Python 2 standard library that doesn't behave well on Windows with UTF-8 characters in this case.

@mingwandroid
Copy link
Contributor

For me, our sphinx package builds fine for python 2.7. We pass -vvv to pip I guess verbose prevents the progress-bar?

@jakirkham
Copy link
Member Author

Think the progress bar point was a different issue I confused with this one. The python-libarchive-c build uses -vvv and still fails the same way.

Are there some other environment variables set in your builds? Wonder how your builds are avoiding this encoding error.

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

No branches or pull requests

6 participants