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

Pip install fails on Windows #19

Open
organisciak opened this issue May 18, 2017 · 3 comments
Open

Pip install fails on Windows #19

organisciak opened this issue May 18, 2017 · 3 comments

Comments

@organisciak
Copy link

byte-compiling C:\Users\organis2\AppData\Local\Continuum\Anaconda3\Lib\site-packages\tests\__init__.py to __init__.cpython-35.pyc
running install_data
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\organis2\AppData\Local\Temp\pip-build-o4ji7g34\htrc\setup.py", line 45, in <module>
    tests_require=['unittest2']
  File "C:\Users\organis2\AppData\Local\Continuum\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\organis2\AppData\Local\Continuum\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\organis2\AppData\Local\Continuum\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\organis2\AppData\Local\Continuum\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\setuptools\command\install.py", line 61, in run
  File "C:\Users\organis2\AppData\Local\Continuum\Anaconda3\lib\distutils\command\install.py", line 551, in run
    self.run_command(cmd_name)
  File "C:\Users\organis2\AppData\Local\Continuum\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\organis2\AppData\Local\Continuum\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\organis2\AppData\Local\Continuum\Anaconda3\lib\distutils\command\install_data.py", line 56, in run
    dir = convert_path(f[0])
  File "C:\Users\organis2\AppData\Local\Continuum\Anaconda3\lib\distutils\util.py", line 127, in convert_path
    raise ValueError("path '%s' cannot end with '/'" % pathname)
ValueError: path 'htrc/mock/volumes/' cannot end with '/'
@organisciak
Copy link
Author

Presumably, this line needs os.path.join: https://github.com/htrc/HTRC-PythonSDK/blob/master/setup.py#L39

@StephenKrewson
Copy link

Encountered this again trying to pip install on Anaconda. Per Disutils docs:

data_files specifies a sequence of (directory, files) pairs in the following way:

setup(...,
data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),
('config', ['cfg/data.cfg']),
('/etc/init.d', ['init-script'])]
)

https://docs.python.org/3/distutils/setupscript.html

In keeping with the format above, the final slashes should be removed from the directory elements in the tuples at:

https://github.com/htrc/HTRC-PythonSDK/blob/master/setup.py#L40

@cassws
Copy link
Contributor

cassws commented Jun 18, 2018

This worked, thank you!! A fellow in our lab encountered the same install issue using pip install on Anaconda. We downloaded the package locally, and modified data_files to exclude the final slashes.

Changed line 87 of setup.py from:

data_files=[('htrc/mock/volumes/', ['htrc/mock/volumes/example.zip']),

('htrc/', ['htrc/.htrc.default'])],

To:

data_files=[('htrc/mock/volumes', ['htrc/mock/volumes/example.zip']),

('htrc', ['htrc/.htrc.default'])],

And then installed by running the install script in the command line:

python setup.py 

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

No branches or pull requests

3 participants