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

error: can't copy 'data/bash-completion/s4cmd': doesn't exist or not a regular file #73

Closed
timh5 opened this Issue Jul 3, 2016 · 8 comments

Comments

Projects
None yet
9 participants
@timh5

timh5 commented Jul 3, 2016

Installing:

  • using root user
  • on Ubuntu 12.04.5 LTS
  • on AWS 64-bit machine
  • Using pip install s4cmd

During install I'm getting this error:

Installing collected packages: s4cmd, boto3, pytz, botocore, jmespath, futures, python-dateutil, docutils, six
  Running setup.py install for s4cmd
    Running command /usr/bin/python -c "import setuptools;__file__='/tmp/build/s4cmd/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-Zvc7O7-record/install-record.txt
    running install
    running build
    running build_py
    running build_scripts
    running install_lib
    running install_data
    error: can't copy 'data/bash-completion/s4cmd': doesn't exist or not a regular file
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/build/s4cmd/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-Zvc7O7-record/install-record.txt:
    running install

running build

running build_py

running build_scripts

running install_lib

running install_data

error: can't copy 'data/bash-completion/s4cmd': doesn't exist or not a regular file

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/build/s4cmd/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-Zvc7O7-record/install-record.txt failed with error code 1
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 228, in run
    requirement_set.install(install_options, global_options)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1093, in install
    requirement.install(install_options, global_options)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 566, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 255, in call_subprocess
    % (command_desc, proc.returncode))
InstallationError: Command /usr/bin/python -c "import setuptools;__file__='/tmp/build/s4cmd/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-Zvc7O7-record/install-record.txt failed with error code 1
"~/.pip/pip.log" 162L, 10020C
@nszceta

This comment has been minimized.

nszceta commented Jul 12, 2016

This package depends on being run as the super user (sudo) so it can copy data/bash-completion/s4cmd to /etc/bash_completion.d/

If it can not, you will get an error: could not create '/etc/bash_completion.d/s4cmd': Permission denied

Workaround: clone the repo and run sudo python setup.py install

@ASavchenkov

This comment has been minimized.

ASavchenkov commented Jul 15, 2016

I'm on osx here and had the same issue. Running it as sudo has no effect. When using the install script, there is another issue where it can't find pytz despite being installed and up to date.

edit: it seems in my case this was caused by my path being set to my 3.5 directory. getting rid of that got it to use the right pip (2.7)

@rcheleguini

This comment has been minimized.

rcheleguini commented Jul 19, 2016

The problem is that the source version of the pip package for some
reason is missing the bash-completion file.

The wheel version does contain the file and the installation goes well.
However, only pip>=1.5 supports wheel packages. The pip available in
Ubuntu 12.04 is pip 1.0.

The workaround for Ubuntu 12.04 is:
sudo pip install pip==1.5
sudo pip install setuptools==0.8 --no-use-wheel --upgrade
sudo pip install s4cmd==2.0.1

@volker48

This comment has been minimized.

volker48 commented Sep 13, 2016

Same issue on OS X and Python 3.5

% sudo pip install s4cmd
The directory '/Users/marcusmccurdy/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/marcusmccurdy/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting s4cmd
  Downloading s4cmd-2.0.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): boto3>=1.3.1 in /usr/local/lib/python3.5/site-packages (from s4cmd)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2016.4 in /usr/local/lib/python3.5/site-packages (from s4cmd)
Requirement already satisfied (use --upgrade to upgrade): s3transfer<0.2.0,>=0.1.0 in /usr/local/lib/python3.5/site-packages (from boto3>=1.3.1->s4cmd)
Requirement already satisfied (use --upgrade to upgrade): jmespath<1.0.0,>=0.7.1 in /usr/local/lib/python3.5/site-packages (from boto3>=1.3.1->s4cmd)
Requirement already satisfied (use --upgrade to upgrade): botocore<1.5.0,>=1.4.1 in /usr/local/lib/python3.5/site-packages (from boto3>=1.3.1->s4cmd)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.5/site-packages (from botocore<1.5.0,>=1.4.1->boto3>=1.3.1->s4cmd)
Requirement already satisfied (use --upgrade to upgrade): docutils>=0.10 in /usr/local/lib/python3.5/site-packages (from botocore<1.5.0,>=1.4.1->boto3>=1.3.1->s4cmd)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /usr/local/lib/python3.5/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.5.0,>=1.4.1->boto3>=1.3.1->s4cmd)
Installing collected packages: s4cmd
  Running setup.py install for s4cmd ... error
    Complete output from command /usr/local/opt/python3/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-hk2vwqm2/s4cmd/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3e24mtj0-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    copying s4cmd.py -> build/lib
    running build_scripts
    creating build/scripts-3.5
    copying s4cmd -> build/scripts-3.5
    copying and adjusting s4cmd.py -> build/scripts-3.5
    changing mode of build/scripts-3.5/s4cmd.py from 644 to 755
    running install_lib
    running install_data
    error: can't copy 'data/bash-completion/s4cmd': doesn't exist or not a regular file

    ----------------------------------------
Command "/usr/local/opt/python3/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-hk2vwqm2/s4cmd/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3e24mtj0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-hk2vwqm2/s4cmd/
@ajkerrigan-mdsol

This comment has been minimized.

ajkerrigan-mdsol commented Nov 28, 2016

In case it helps anyone else, here's a workaround I used on OSX:

# Try the initial install with a hardcoded build directory, don't clean up if/when it fails
pip install -b ~/pip-build --no-clean s4cmd

# Go into the build directory and pull down the missing bash completion script
cd ~/pip-build/s4cmd
mkdir -p data/bash-completion
curl -Lo ./data/bash-completion/s4cmd https://raw.githubusercontent.com/bloomreach/s4cmd/2.0.1/data/bash-completion/s4cmd

# Install from the now-complete build directory
sudo -H pip install ./

# Clean up your mess
cd ~
rm -rf ~/pip-build

It's hacky for sure, and perhaps better to just clone the repo and run setup manually. But hey, it's an option :).

@neurosnap

This comment has been minimized.

neurosnap commented May 10, 2017

Running into the same issue. It looks like the data files are not packaged with pypi. Generally a package maintainer needs to include a MANIFEST file to package the files.

@rhinoman

This comment has been minimized.

rhinoman commented Dec 24, 2017

I'm seeing this on Archlinux running pip install s4cmd as root.

@navinpai

This comment has been minimized.

Member

navinpai commented May 23, 2018

The change was merged with master. Once pip is updated, this sudo pip install s4cmd would work again.

There's an open discussion on whether the requirement for sudo makes sense at all (#94), so will take a look at that as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment