Upgrading app from python 2.7 to 3.4 and nose is generating the following error:
Collecting nose==1.3.4 (from -r requirements/dev.txt (line 9))
Exception:
Traceback (most recent call last):
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/commands/install.py", line 339, in run
requirement_set.prepare_files(finder)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/req/req_set.py", line 333, in prepare_files
upgrade=self.upgrade,
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/index.py", line 305, in find_requirement
page = self._get_page(main_index_url, req)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/index.py", line 795, in _get_page
return HTMLPage.get_page(link, req, session=self.session)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/index.py", line 884, in get_page
"Cache-Control": "max-age=600",
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py", line 473, in get
return self.request('GET', url, **kwargs)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/download.py", line 332, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py", line 461, in request
resp = self.send(prep, **send_kwargs)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/cachecontrol/adapter.py", line 36, in send
cached_response = self.controller.cached_request(request)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/cachecontrol/controller.py", line 100, in cached_request
resp = self.serializer.loads(request, self.cache.get(cache_url))
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py", line 62, in loads
return getattr(self, "_loads_v{0}".format(ver))(request, data)
File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py", line 91, in _loads_v1
body = io.BytesIO(cached["response"].pop("body"))
TypeError: 'str' does not support the buffer interface
Running: OSX 10.10, brew, python 3.4, virtualenv and virtualenvwrapper
mkvirtualenv python3.4 --python=/usr/local/bin/python3
Works fine on python 2.7
You have to update the pip installation of your virtual environment to solve this problem.
Related
I've been trying to set up a virtual environment for django using pipenv. I've installed pipenv and configured the path properly. When I run the following command
pipenv --version
I get
pipenv, version 2022.9.8
Which implies that pipenv is working.
But when I attempt to install django with the following command
pipenv install django
I get the following error.
C:\Users\Saifia>pipenv install django
Traceback (most recent call last):
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 620, in parse_executable
result_version = get_python_version(path)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\utils.py", line 97, in get_python_version
c = subprocess.Popen(version_cmd, **subprocess_kwargs)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts\pipenv.exe\__main__.py", line 7, in <module>
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\click\core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\cli\options.py", line 57, in main
return super().main(*args, **kwargs, windows_expand_args=False)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\click\core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\click\decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\cli\command.py", line 236, in install
do_install(
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\core.py", line 2056, in do_install
ensure_project(
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\core.py", line 526, in ensure_project
ensure_virtualenv(
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\core.py", line 447, in ensure_virtualenv
python = ensure_python(project, three=three, python=python)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\core.py", line 336, in ensure_python
path_to_python = find_a_system_python(python)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\core.py", line 302, in find_a_system_python
return next(iter(finder.find_all_python_versions()), None)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 307, in find_all_python_versions
python_version_dict = getattr(self.system_path, "python_version_dict", {})
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 115, in system_path
self._system_path = self.create_system_path()
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 77, in create_system_path
return pyfinder_path.SystemPath.create(
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\path.py", line 696, in create
instance = instance._run_setup()
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\path.py", line 247, in _run_setup
new_instance = new_instance._setup_windows()
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\path.py", line 425, in _setup_windows
windows_finder = WindowsFinder.create()
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\windows.py", line 149, in create
return cls()
File "<attrs generated init pythonfinder.models.windows.WindowsFinder>", line 13, in __init__
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\windows.py", line 116, in get_versions
versions[py_version.version_tuple[:5]] = base_dir
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 367, in __getattribute__
result = super(PythonVersion, self).__getattribute__(key)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 432, in version_tuple
self.patch,
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 377, in __getattribute__
instance_dict = self.parse_executable(executable)
File "C:\Users\Saifia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 622, in parse_executable
raise ValueError("Not a valid python path: %r" % path)
ValueError: Not a valid python path: 'C:/Users/Saifia/anaconda3/Scripts/python.exe'
I've been trying to figure this out the whole day and have tried various things but I'm new this and I can't figure out my mistake.
Any help will be greatly appreciated!
I was using virtualenv for virtualization and had to use pipenv to follow a tutorial and could not get pipenv to work. I had to uninstall virtualenv and pipenv and reinstall pipenv for it to work. I am still using pipenv but I do not like it virtualenv works better for me.
I think that the key to your problem is the last message in the traceback:
"ValueError: Not a valid python path: 'C:/Users/Saifia/anaconda3/Scripts/python.exe'"
Check and see if this file exists at this location.
If not, your default python version isn't set correctly in pipenv.
Deactivate any virtual environment and check your python version before you install pipenv.
The problem
On a fresh and minimal Ubuntu 20.04 installation with ufw inactive:
pip3 fails with HTTPSConnectionPool timeout.
pip3 fails to install or update any package in a freshly installed OS.
pip3 fails with the same error when installing local wheel files.
pip3 fails in both a virtual python environment and at the system-level environment.
Environment
Ubuntu 20.04 LTS
fresh install,
apt updated/upgraded
Python 3.8
Additional details
--default-timeout=100
--default-timeout=1000
UPDATE:
Traceback after user-interrupt python -m pip install -U pip
^CERROR: Operation cancelled by user
^CTraceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/__main__.py", line 26, in <module>
sys.exit(_main())
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 75, in main
return command.main(cmd_args)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 114, in main
return self._main(args)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 226, in _main
self.handle_pip_version_check(options)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 158, in handle_pip_version_check
pip_self_version_check(session, options)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py", line 207, in pip_self_version_check
best_candidate = finder.find_best_candidate("pip").best_candidate
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 883, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 827, in find_all_candidates
package_links = self.process_project_url(
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 792, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/collector.py", line 612, in fetch_page
return _get_html_page(location, session=self.session)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/collector.py", line 451, in _get_html_page
resp = _get_html_response(url, session=session)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/collector.py", line 149, in _get_html_response
resp = session.get(
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/network/session.py", line 421, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/cachecontrol/adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/connectionpool.py", line 994, in _validate_conn
conn.connect()
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/connection.py", line 352, in connect
self.sock = ssl_wrap_socket(
File "/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
KeyboardInterrupt
UPDATE
Sanity check - OK
laptop082:468$ curl https://pypi.org:443/simple/pip/
<!DOCTYPE html>
<html>
<head>
<meta name="pypi:repository-version" content="1.0">
<title>Links for pip</title>
</head>
<body>
<h1>Links for pip</h1>
pip-0.2.tar.gz<br/>
.
.
.
Questions
What are my options?
Will a Ubuntu re-install be necessary?
UPDATE:
Re-installation of Ubuntu 20.04 did not resolve the problem.
Please advise.
I'm new to python and github. when I'm trying to install few submodules getting below error.
I'm using git bash on windows
pip is at latest version 20.2.3.
able to install other submodules using poetry successfully
$ poetry install -vvv
Using virtualenv: E:\Dev\venv\venv_test
Installing dependencies from lock file
[CalledProcessError]
Command '['C:\\Users\\88810\\AppData\\Local\\Temp\\tziwqwewd56\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 3221226505.
Traceback (most recent call last):
File "C:\Users\88810\.poetry\lib\poetry\_vendor\py3.6\clikit\console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "C:\Users\88810\.poetry\lib\poetry\_vendor\py3.6\clikit\api\command\command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "C:\Users\88810\.poetry\lib\poetry\_vendor\py3.6\clikit\api\command\command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "C:\Users\88810\.poetry\lib\poetry\_vendor\py3.6\cleo\commands\command.py", line 92, in wrap_handle
return self.handle()
File "C:\Users\88810\.poetry\lib\poetry\console\commands\install.py", line 69, in handle
return_code = installer.run()
File "C:\Users\88810\.poetry\lib\poetry\installation\installer.py", line 74, in run
self._do_install(local_repo)
File "C:\Users\88810\.poetry\lib\poetry\installation\installer.py", line 225, in _do_install
ops = solver.solve(use_latest=whitelist)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\solver.py", line 36, in solve
packages, depths = self._solve(use_latest=use_latest)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\solver.py", line 181, in _solve
self._package, self._provider, locked=locked, use_latest=use_latest
File "C:\Users\88810\.poetry\lib\poetry\mixology\__init__.py", line 7, in resolve_version
return solver.solve()
File "C:\Users\88810\.poetry\lib\poetry\mixology\version_solver.py", line 80, in solve
next = self._choose_package_version()
File "C:\Users\88810\.poetry\lib\poetry\mixology\version_solver.py", line 388, in _choose_package_version
version = self._provider.complete_package(version)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 601, in complete_package
self.search_for_vcs(r)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 175, in search_for_vcs
name=dependency.name,
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 213, in get_package_from_vcs
package = cls.get_package_from_directory(tmp_dir, name=name)
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 361, in get_package_from_directory
cls._execute_setup()
File "C:\Users\88810\.poetry\lib\poetry\puzzle\provider.py", line 872, in _execute_setup
EnvManager.build_venv(tmp_dir)
File "C:\Users\88810\.poetry\lib\poetry\utils\env.py", line 688, in build_venv
builder.create(str(path))
File "E:\python36\lib\venv\__init__.py", line 67, in create
self._setup_pip(context)
File "E:\python36\lib\venv\__init__.py", line 245, in _setup_pip
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
File "E:\python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Users\88810\.poetry\lib\poetry\utils\_compat.py", line 206, in run
retcode, process.args, output=stdout, stderr=stderr
(venv_test)
I was able to resolve the issue after following these steps:
Upgraded python 3.6 to 3.7.4.
I had earlier installed python on E drive, installed it on C drive.
Software stack version:
Spyder 3.2.4
Python 3.5
Zipline 1.1.1
OSX El capitan
When running Zipline from terminal just to try it out:
$ zipline run -f buyapple.py --start 2000-1-1 --end 2014-1-1 -o buyapple_out.pickle
The following error appears:
[2017-12-06 13:17:02.124791] INFO: Loader: Cache at /.../.zipline/data/SPY_benchmark.csv does not have data from 1990-01-02 00:00:00+00:00 to 2017-12-04 00:00:00+00:00.
[2017-12-06 13:17:02.136427] INFO: Loader: Downloading benchmark data for 'SPY' from 1989-12-29 00:00:00+00:00 to 2017-12-04 00:00:00+00:00
Traceback (most recent call last):
File "/Users/newuer/anaconda3/bin/zipline", line 11, in <module>
load_entry_point('zipline==1.1.1', 'console_scripts', 'zipline')()
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/zipline/__main__.py", line 97, in _
return f(*args, **kwargs)
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/zipline/__main__.py", line 240, in run
environ=os.environ,
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/zipline/utils/run_algo.py", line 132, in _run
env = TradingEnvironment(asset_db_path=connstr, environ=environ)
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/zipline/finance/trading.py", line 99, in __init__
self.bm_symbol,
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/zipline/data/loader.py", line 166, in load_market_data
environ,
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/zipline/data/loader.py", line 230, in ensure_benchmark_data
last_date,
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/zipline/data/benchmarks.py", line 50, in get_benchmark_returns
last_date
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/pandas_datareader/data.py", line 137, in DataReader
session=session).read()
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/pandas_datareader/base.py", line 181, in read
params=self._get_params(self.symbols))
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/pandas_datareader/base.py", line 79, in _read_one_data
out = self._read_url_as_StringIO(url, params=params)
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/pandas_datareader/base.py", line 98, in _read_url_as_StringIO
out.write(bytes_to_str(text))
File "/Users/newuer/anaconda3/lib/python3.5/site-packages/pandas/compat/__init__.py", line 72, in bytes_to_str
return b.decode(encoding or 'utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 18112: invalid start byte
I have also tried putting the SPY_benchmark_data.csv directly inside the .zipline/data/ folder, and still the error is produced.
I have also tried a clean install of conda and python env 3.4 -- same issue.
When I wanted to install pip, the error just came out:
C:\Users\xd>python get-pip.py install
Collecting install
Exception:
Traceback (most recent call last):
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\commands\install.py", line 324, in run
requirement_set.prepare_files(finder)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\req\req_set.py", line 554, in _prepare_file
require_hashes
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\req\req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\sessions.py", line 488, in get
return self.request('GET', url, **kwargs)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\cachecontrol\adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\adapters.py", line 423, in send
timeout=timeout
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 589, in urlopen
self._prepare_proxy(conn)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 797, in _prepare_proxy
conn.connect()
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\connection.py", line 254, in connect
conn = self._new_conn()
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\connection.py", line 142, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\util\connection.py", line 66, in create_connection
if host.startswith('['):
AttributeError: 'NoneType' object has no attribute 'startswith'
What can I do?
For recent Python versions (3.4+), you don't need to use the get-pip.py script anymore. Just run python -m ensurepip, and the ensurepip module will do everything the get-pip.py script used to do.