trek10inc / awsume

A utility for easily assuming AWS IAM roles from the command line.
https://awsu.me
MIT License
494 stars 90 forks source link

Can't install on OSX High Sierra - (problem with six) #30

Closed burnsjake closed 6 years ago

burnsjake commented 6 years ago

$ sudo easy_install pip Searching for pip Best match: pip 9.0.3 Processing pip-9.0.3-py2.7.egg pip 9.0.3 is already the active version in easy-install.pth Installing pip script to /usr/local/bin Installing pip2.7 script to /usr/local/bin Installing pip2 script to /usr/local/bin

Using /Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg Processing dependencies for pip Finished processing dependencies for pip $ pip install awsume Collecting awsume Using cached awsume-3.0.10.tar.gz Collecting boto3 (from awsume) Using cached boto3-1.6.20-py2.py3-none-any.whl Collecting psutil (from awsume) Using cached psutil-5.4.3.tar.gz Collecting yapsy (from awsume) Using cached Yapsy-1.11.223.tar.gz Collecting future (from awsume) Using cached future-0.16.0.tar.gz Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /Library/Python/2.7/site-packages (from boto3->awsume) Collecting s3transfer<0.2.0,>=0.1.10 (from boto3->awsume) Using cached s3transfer-0.1.13-py2.py3-none-any.whl Collecting botocore<1.10.0,>=1.9.20 (from boto3->awsume) Using cached botocore-1.9.20-py2.py3-none-any.whl Requirement already satisfied: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in /Library/Python/2.7/site-packages (from s3transfer<0.2.0,>=0.1.10->boto3->awsume) Collecting python-dateutil<2.7.0,>=2.1 (from botocore<1.10.0,>=1.9.20->boto3->awsume) Using cached python_dateutil-2.6.1-py2.py3-none-any.whl Collecting docutils>=0.10 (from botocore<1.10.0,>=1.9.20->boto3->awsume) Using cached docutils-0.14-py2-none-any.whl Collecting six>=1.5 (from python-dateutil<2.7.0,>=2.1->botocore<1.10.0,>=1.9.20->boto3->awsume) Using cached six-1.11.0-py2.py3-none-any.whl Installing collected packages: six, python-dateutil, docutils, botocore, s3transfer, boto3, psutil, yapsy, future, awsume Found existing installation: six 1.4.1 DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project. Uninstalling six-1.4.1: Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_set.py", line 778, in install requirement.uninstall(auto_confirm=True) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_install.py", line 754, in uninstall paths_to_remove.remove(auto_confirm) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove renames(path, new_path) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/utils/init.py", line 267, in renames shutil.move(old, new) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move copy2(src, real_dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2 copystat(src, dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat os.chflags(dst, st.stflags) OSError: [Errno 1] Operation not permitted: '/var/folders/l/vnj7g_9n6pz4s9r5xclyl10cdbfp4x/T/pip-xARziy-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info' $ sudo pip install awsume The directory '/Users/jburns/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/jburns/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 awsume Downloading awsume-3.0.10.tar.gz Collecting boto3 (from awsume) Downloading boto3-1.6.20-py2.py3-none-any.whl (128kB) 100% |████████████████████████████████| 133kB 2.2MB/s Collecting psutil (from awsume) Downloading psutil-5.4.3.tar.gz (412kB) 100% |████████████████████████████████| 419kB 2.5MB/s Collecting yapsy (from awsume) Downloading Yapsy-1.11.223.tar.gz (80kB) 100% |████████████████████████████████| 81kB 7.7MB/s Collecting future (from awsume) Downloading future-0.16.0.tar.gz (824kB) 100% |████████████████████████████████| 829kB 1.4MB/s Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /Library/Python/2.7/site-packages (from boto3->awsume) Collecting s3transfer<0.2.0,>=0.1.10 (from boto3->awsume) Downloading s3transfer-0.1.13-py2.py3-none-any.whl (59kB) 100% |████████████████████████████████| 61kB 5.0MB/s Collecting botocore<1.10.0,>=1.9.20 (from boto3->awsume) Downloading botocore-1.9.20-py2.py3-none-any.whl (4.1MB) 100% |████████████████████████████████| 4.1MB 334kB/s Requirement already satisfied: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in /Library/Python/2.7/site-packages (from s3transfer<0.2.0,>=0.1.10->boto3->awsume) Collecting python-dateutil<2.7.0,>=2.1 (from botocore<1.10.0,>=1.9.20->boto3->awsume) Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB) 100% |████████████████████████████████| 194kB 5.2MB/s Collecting docutils>=0.10 (from botocore<1.10.0,>=1.9.20->boto3->awsume) Downloading docutils-0.14-py2-none-any.whl (543kB) 100% |████████████████████████████████| 552kB 2.4MB/s Collecting six>=1.5 (from python-dateutil<2.7.0,>=2.1->botocore<1.10.0,>=1.9.20->boto3->awsume) Downloading six-1.11.0-py2.py3-none-any.whl Installing collected packages: six, python-dateutil, docutils, botocore, s3transfer, boto3, psutil, yapsy, future, awsume Found existing installation: six 1.4.1 DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project. Uninstalling six-1.4.1: Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_set.py", line 778, in install requirement.uninstall(auto_confirm=True) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_install.py", line 754, in uninstall paths_to_remove.remove(auto_confirm) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove renames(path, new_path) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/utils/init.py", line 267, in renames shutil.move(old, new) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move copy2(src, real_dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2 copystat(src, dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat os.chflags(dst, st.st_flags) OSError: [Errno 1] Operation not permitted: '/tmp/pip-S6cVNR-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

mbarneyjr commented 6 years ago

This has been documented in the "Troubleshooting" section of the wiki

https://github.com/trek10inc/awsume/wiki/Troubleshooting

To solve this issue, run your pip install command with the --ignore-installed six flag

Let us know if this works or if you're still experiencing any issues! Thanks!

burnsjake commented 6 years ago

Tried with the --ignore-installed six flag and it still fails. $ pip install awsume --ignore-installed six Collecting awsume Using cached awsume-3.0.10.tar.gz Collecting six Using cached six-1.11.0-py2.py3-none-any.whl Collecting boto3 (from awsume) Downloading boto3-1.6.21-py2.py3-none-any.whl (128kB) 100% |████████████████████████████████| 133kB 2.5MB/s Collecting psutil (from awsume) Using cached psutil-5.4.3.tar.gz Collecting yapsy (from awsume) Using cached Yapsy-1.11.223.tar.gz Collecting future (from awsume) Using cached future-0.16.0.tar.gz Collecting s3transfer<0.2.0,>=0.1.10 (from boto3->awsume) Using cached s3transfer-0.1.13-py2.py3-none-any.whl Collecting jmespath<1.0.0,>=0.7.1 (from boto3->awsume) Using cached jmespath-0.9.3-py2.py3-none-any.whl Collecting botocore<1.10.0,>=1.9.21 (from boto3->awsume) Downloading botocore-1.9.21-py2.py3-none-any.whl (4.1MB) 100% |████████████████████████████████| 4.1MB 374kB/s Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer<0.2.0,>=0.1.10->boto3->awsume) Using cached futures-3.2.0-py2-none-any.whl Collecting python-dateutil<2.7.0,>=2.1 (from botocore<1.10.0,>=1.9.21->boto3->awsume) Using cached python_dateutil-2.6.1-py2.py3-none-any.whl Collecting docutils>=0.10 (from botocore<1.10.0,>=1.9.21->boto3->awsume) Using cached docutils-0.14-py2-none-any.whl Installing collected packages: futures, jmespath, six, python-dateutil, docutils, botocore, s3transfer, boto3, psutil, yapsy, future, awsume Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_set.py", line 784, in install **kwargs File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files clobber(source, lib_dir, True) File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/wheel.py", line 323, in clobber shutil.copyfile(srcfile, destfile) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile with open(dst, 'wb') as fdst: IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/futures-3.2.0.dist-info/RECORD'

mbarneyjr commented 6 years ago

Have you tried running it with sudo and --ignore-installed six?

burnsjake commented 6 years ago

That worked this time around. Also unsure if awsume should be installed using the --user flag. Are there recommendations regarding using stock OSX python or python3 from brew?

mbarneyjr commented 6 years ago

AWSume should work with with stock python installations, package manager (like brew/apt) installations, installations from python.org, and pyenv installations (we try to make it installable under any type of python installation, within reason).

Personally, before I started using pyenv, I would install python with the --user flag to minimize my use of sudo, and I never experienced any issues. What makes you unsure of installing it with the --user flag? If you had any issues we're open to feedback!

burnsjake commented 6 years ago

pip install awsume --ignore-installed six --user says it successfully installed. Afterward, running awsume fails. Bash is unable to find awsume. $ pip install awsume --ignore-installed six --user Collecting awsume Using cached awsume-3.0.10.tar.gz Collecting six Using cached six-1.11.0-py2.py3-none-any.whl Collecting boto3 (from awsume) Using cached boto3-1.6.21-py2.py3-none-any.whl Collecting psutil (from awsume) Using cached psutil-5.4.3.tar.gz Collecting yapsy (from awsume) Using cached Yapsy-1.11.223.tar.gz Collecting future (from awsume) Using cached future-0.16.0.tar.gz Collecting s3transfer<0.2.0,>=0.1.10 (from boto3->awsume) Using cached s3transfer-0.1.13-py2.py3-none-any.whl Collecting jmespath<1.0.0,>=0.7.1 (from boto3->awsume) Using cached jmespath-0.9.3-py2.py3-none-any.whl Collecting botocore<1.10.0,>=1.9.21 (from boto3->awsume) Using cached botocore-1.9.21-py2.py3-none-any.whl Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer<0.2.0,>=0.1.10->boto3->awsume) Using cached futures-3.2.0-py2-none-any.whl Collecting python-dateutil<2.7.0,>=2.1 (from botocore<1.10.0,>=1.9.21->boto3->awsume) Using cached python_dateutil-2.6.1-py2.py3-none-any.whl Collecting docutils>=0.10 (from botocore<1.10.0,>=1.9.21->boto3->awsume) Using cached docutils-0.14-py2-none-any.whl Installing collected packages: futures, jmespath, six, python-dateutil, docutils, botocore, s3transfer, boto3, psutil, yapsy, future, awsume Running setup.py install for psutil ... done Running setup.py install for yapsy ... done Running setup.py install for future ... done Running setup.py install for awsume ... done Successfully installed awsume-3.0.10 boto3-1.6.21 botocore-1.9.21 docutils-0.14 future-0.16.0 futures-3.2.0 jmespath-0.9.3 psutil-5.4.3 python-dateutil-2.6.1 s3transfer-0.1.13 six-1.11.0 yapsy-1.11.223 $ awsume -bash: /usr/local/bin/awsume: No such file or directory After running: sudo pip install awsume --ignore-installed six. It seems to be installed correctly as it cannot find a profile...