Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

python3 incorrect permissions on pip #469

Closed
andrewjpage opened this issue Jul 8, 2015 · 10 comments
Closed

python3 incorrect permissions on pip #469

andrewjpage opened this issue Jul 8, 2015 · 10 comments
Labels

Comments

@andrewjpage
Copy link
Contributor

When installing python3 it fails at the end. Setting chmodding pip with +w fixes the issue.

Copying pip.egg-info to /home/vagrant/.linuxbrew/lib/python3.4/site-packages/pip-7.1.0-py3.4.egg-info
running install_scripts
Installing pip script to /home/vagrant/.linuxbrew/Cellar/python3/3.4.3_1/bin
Installing pip3.4 script to /home/vagrant/.linuxbrew/Cellar/python3/3.4.3_1/bin
error: [Errno 13] Permission denied: '/home/vagrant/.linuxbrew/Cellar/python3/3.4.3_1/bin/pip3.4'
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall python3`

To replicate the issue on a clean CentOS7 VM with vagrant & virutalbox:

vagrant init chef/centos-7.0
vagrant up --provider virtualbox
vagrant ssh -c "sudo yum install -y epel-release gcc gcc-c++ automake"
vagrant ssh -c "sudo yum groupinstall -y 'Development Tools' && sudo yum install -y curl git m4 ruby texinfo bzip2-devel curl-devel expat-devel ncurses-devel zlib-devel"
vagrant ssh -c "git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew"
vagrant ssh -c "echo 'export PATH=\"\$HOME/.linuxbrew/bin:\$PATH\"' >> .bashrc"
vagrant ssh -c "ln -s \$(which gcc) ~/.linuxbrew/bin/gcc-4.8"
vagrant ssh -c "ln -s \$(which g++) ~/.linuxbrew/bin/g++-4.8"
vagrant ssh -c "ln -s \$(which gfortran) ~/.linuxbrew/bin/gfortran-4.8"
vagrant ssh -c "brew install python3"
@sjackman sjackman added the bug label Jul 8, 2015
@sjackman sjackman self-assigned this Jul 8, 2015
@sjackman
Copy link
Member

sjackman commented Jul 8, 2015

That's awfully strange. Any idea why pip isn't being set executable? I haven't run into this issue yet myself.

@andrewjpage
Copy link
Contributor Author

It appears to have been introduced 2 days ago by this commit (I did a checkout and install on a clean VM) b83eb23

I'm new to this codebase so not sure about the cleanest way to fix it.

@sjackman sjackman removed their assignment Jul 9, 2015
@sjackman
Copy link
Member

sjackman commented Jul 9, 2015

I'm not sure what's gone wrong. I'll leave this issue open in the hopes that someone is able to help troubleshoot.

@xu-cheng
Copy link
Contributor

xu-cheng commented Jul 9, 2015

May need to ping @tdsmith who is our Python expert.

@tdsmith
Copy link
Contributor

tdsmith commented Jul 9, 2015

When installing python3 it fails at the end. Setting chmodding pip with +w fixes the issue.

Can you elaborate wrt which file you modified and how you demonstrated that it helped?

@andrewjpage
Copy link
Contributor Author

I just set everything to be writable (so not a proper solution at all), then reran the end of the install (which then worked):

chmod +w /home/vagrant/.linuxbrew/Cellar/python3/3.4.3_1/bin/*
brew postinstall python3

It occurs on a fresh install of CentOS 6.6 & 7.0, and Ubuntu Trusty.

@tdsmith tdsmith self-assigned this Jul 9, 2015
tdsmith added a commit to tdsmith/homebrew that referenced this issue Jul 9, 2015
We don't want to run ensurepip, which installs an old version of pip; we
take care of this ourselves in postinstall.

On flat (i.e. non-Framework) builds, ensurepip causes an error in postinstall
because the pip-3.4 script already exists in prefix/bin.

Will resolve Linuxbrew/legacy-linuxbrew#469.
@tdsmith
Copy link
Contributor

tdsmith commented Jul 9, 2015

The python3 build runs ensurepip by default. For Framework builds, the pip script ends up getting written somewhere in the Framework tree, so it doesn't cause a conflict. Linuxbrew does a non-framework build, which exposes the conflict.

Homebrew/legacy-homebrew#41544 disables running ensurepip and will resolve this issue the next time Shaun merges from Homebrew/homebrew.

@tdsmith
Copy link
Contributor

tdsmith commented Jul 9, 2015

Thanks for reporting & the detailed reproduction instructions, btw!

@sjackman
Copy link
Member

sjackman commented Jul 9, 2015

Thanks for the fix, Tim.

@andrewjpage
Copy link
Contributor Author

Thanks for getting to the bottom of it so quickly. Andrew

sjackman added a commit that referenced this issue Jul 10, 2015
Conflicts:
	Library/Formula/dos2unix.rb
	Library/Formula/python.rb
	Library/Formula/python3.rb

Closes #469
sjackman added a commit to Linuxbrew/brew that referenced this issue Apr 23, 2016
Conflicts:
	Library/Formula/dos2unix.rb
	Library/Formula/python.rb
	Library/Formula/python3.rb

Closes Linuxbrew/legacy-linuxbrew#469
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants