安装boto3时出错 - python-dateutil 1.5

时间:2018-01-17 13:26:52

标签: python pip macos-sierra boto3 macos-high-sierra

我尝试在运行High Sierra for AWS Cli的Mac上安装boto3,并且我不断收到以下错误:

Collecting boto3
  Using cached boto3-1.5.16-py2.py3-none-any.whl
Collecting botocore<1.9.0,>=1.8.30 (from boto3)
  Using cached botocore-1.8.30-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.10 (from boto3)
  Using cached s3transfer-0.1.12-py2.py3-none-any.whl
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /Library/Python/2.7/site-packages (from boto3)
Requirement already satisfied: docutils>=0.10 in /Library/Python/2.7/site-packages (from botocore<1.9.0,>=1.8.30->boto3)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.9.0,>=1.8.30->boto3)
  Using cached python_dateutil-2.6.1-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)
  Using cached futures-3.2.0-py2-none-any.whl
Requirement already satisfied: six>=1.5 in /Library/Python/2.7/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.9.0,>=1.8.30->boto3)
Installing collected packages: python-dateutil, botocore, futures, s3transfer, boto3
  Found existing installation: python-dateutil 1.5
    Uninstalling python-dateutil-1.5:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-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.1-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.1-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.1-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.1-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.1-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 299, in move
    copytree(src, real_dst, symlinks=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/zoneinfo-2010g.tar.gz', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/zoneinfo-2010g.tar.gz', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/zoneinfo-2010g.tar.gz'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.py', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.py', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.pyc', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.pyc', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.py', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.py', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.pyc', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.pyc', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.pyc', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.pyc', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.py', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.py', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.py', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.py', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.py', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.py', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.pyc', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.pyc', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.py', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.py', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.pyc', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.pyc', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.pyc', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.pyc', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.pyc', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.pyc', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil', '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil', "[Errno 1] Operation not permitted: '/var/folders/7b/yjnqplp56yq9g01b4z6zfpww0000gn/T/pip-VFHRFW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil'")]

我已经尝试运行pip uninstall python-dateutil来卸载它以重新安装,以防出现问题,但是会产生相同的错误。厌倦了用sudo运行命令但仍然得到相同的错误。

有没有解决这个问题?或者另一种安装boto3的方法?

我正在使用Pip版本9.0.1和Python 2.7.10

2 个答案:

答案 0 :(得分:0)

现在修复它。

我用过:

sudo pip install -ignore-installed python-util

这意味着我可以安装boto3,因为它不再查看旧版本1.5并尝试卸载它。

答案 1 :(得分:0)

我尝试过

 try {

           String sysEnvStr = System.getenv("CASSANDRA_HOME");//having path as  C:\Program Files\apache-cassandra-3.11.2

           Process p = Runtime.getRuntime().exec("cmd /k start cqlsh.bat", null, new File(sysEnvStr + "\\bin"));

           BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
           BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
           BufferedWriter output = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));

           output.write("COPY mydb.processed_data FROM processed_file.csv");
           output.flush();
           output.close();

           // read the output from the command
           String s = "";

           while ((s = stdInput.readLine()) != null) {
              System.out.println(s);
           }
           while ((s = stdError.readLine()) != null) {
              System.out.println("Std ERROR : " + s);
           }
           int returnCode = p.waitFor();
           System.out.println("Return code = " + returnCode);

        } catch (IOException ex) {
            Logger.getLogger(TempTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InterruptedException ex) {
            Logger.getLogger(TempTest.class.getName()).log(Level.SEVERE, null, ex);
        }

发布以下内容

sudo -H pip install --ignore-installed python-dateutil

谢谢