How can I fix this error and ingest data from Quandl? Thank you - quandl

When I try to run the command in my terminal, it raises an error
I'm using anaconda to install my packages and python 2.7.
$ zipline ingest -b quandl
Traceback (most recent call last):
File "/anaconda3/bin/zipline", line 6, in <module>
from pkg_resources import load_entry_point
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3241, in <module>
#_call_aside
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'mock>=2.0' distribution was not found and is required by tables

It seems you need to install the mock package:
conda install mock
or, if the previous doesn't work:
conda install -c conda-forge mock

Related

CKAN Docker install seems perfect except ckan container exits immediately after a restart

My CKAN Docker install seems perfect except that the ckan container exits immediately after a restart.strong textI have repeatedly tried a rebuild of the docker containers. I see no errors except a reference to the deprecation of python2. Please advise on any issues that I may have overlooked or something missing. This installation is on Ubuntu 19.10.
docker log is as follows:
Command 'db' not known (you may need to run setup.py egg_info)
Known commands:
create Create the file layout for a Python distribution
Traceback (most recent call last):
File "/usr/local/bin/ckan-paster", line 8, in <module>
sys.exit(run())
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 806, in run
command.load().summary))
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2321, in load
return self.resolve()
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2327, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/ckan/venv/src/ckan/ckanext/datapusher/cli.py", line 7, in <module>
import ckan.lib.cli as cli
File "/usr/lib/ckan/venv/src/ckan/ckan/lib/cli.py", line 17, in <module>
from ckan.cli import load_config as _get_config
File "/usr/lib/ckan/venv/src/ckan/ckan/cli/__init__.py", line 8, in <module>
from configparser import ConfigParser
ImportError: No module named configparser
Command 'db' not known (you may need to run setup.py egg_info)
Known commands:
create Create the file layout for a Python distribution
Traceback (most recent call last):
File "/usr/local/bin/ckan-paster", line 8, in <module>
sys.exit(run())
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 806, in run
command.load().summary))
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2321, in load
return self.resolve()
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2327, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/ckan/venv/src/ckan/ckanext/datapusher/cli.py", line 7, in <module>
import ckan.lib.cli as cli
File "/usr/lib/ckan/venv/src/ckan/ckan/lib/cli.py", line 17, in <module>
from ckan.cli import load_config as _get_config
File "/usr/lib/ckan/venv/src/ckan/ckan/cli/__init__.py", line 8, in <module>
from configparser import ConfigParser
ImportError: No module named configparser
Traceback (most recent call last):
File "/usr/local/bin/ckan-paster", line 8, in <module>
Command 'db' not known (you may need to run setup.py egg_info)
Known commands:
create Create the file layout for a Python distribution
sys.exit(run())
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 806, in run
command.load().summary))
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2321, in load
return self.resolve()
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2327, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/ckan/venv/src/ckan/ckanext/datapusher/cli.py", line 7, in <module>
import ckan.lib.cli as cli
File "/usr/lib/ckan/venv/src/ckan/ckan/lib/cli.py", line 17, in <module>
from ckan.cli import load_config as _get_config
File "/usr/lib/ckan/venv/src/ckan/ckan/cli/__init__.py", line 8, in <module>
from configparser import ConfigParser
ImportError: No module named configparser
You are using python 2.7 but importing configparser, which is Python 3 module. Check which version you are pooling from the Docker, I think you need 2.8.x tag as the latest stable.

my docker-compose couldn't work and show me "pkg_resources.VersionConflict..."

my docker-compose was installed by pip as pip install docker-compose, My OS is Ubuntu 18.04.3 LTS.
my python version is 3.6.9, pip version is most lasted and docker version is 19.03.5 .
Then when I try docker-compose version, i just get...
Traceback (most recent call last):
File "/home/blackcat/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/home/blackcat/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/blackcat/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (docker-compose 1.25.3 (/home/blackcat/.local/lib/python3.6/site-packages), Requirement.parse('docker-compose==1.17.1'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 6, in <module>
from pkg_resources import load_entry_point
File "/home/blackcat/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3252, in <module>
#_call_aside
File "/home/blackcat/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3236, in _call_aside
f(*args, **kwargs)
File "/home/blackcat/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3265, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/home/blackcat/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 586, in _build_master
return cls._build_from_requirements(__requires__)
File "/home/blackcat/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/home/blackcat/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'docker-compose==1.17.1' distribution was not found and is required by the application
I Googled many solutions but nothing like that.
I installed docker-compose with apt-get (version 1.17.1) and had a "pkg_resources.DistributionNotFound" error.
I removed that version and installed another with:
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
and it does work for now.
Hope is helpfull!

Kivy Buildozer VM sh.ErrorReturnCode_127 error

I am trying to build a simple Python program to an APK with Buildozer on the Kivy Virtual Machine. Every time I run buildozer android debug, I get the following error
pid 2134:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 815, in handle_command_exit_code
raise exc
ErrorReturnCode_127:
RAN: /home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform /build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh
STDOUT:
/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/build /build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found
STDERR:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform /python-for-android/pythonforandroid/toolchain.py", line 1073, in <module>
main()
File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1067, in main
ToolchainCL()
File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 576, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 151, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "pythonforandroid/build.py", line 562, in build_recipes
File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/libffi/__init__.py", line 33, in build_arch
shprint(sh.Command('./autogen.sh'), _env=env)
File "pythonforandroid/logger.py", line 178, in shprint
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 863, in next
self.wait()
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_127:
RAN: /home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh
STDOUT:
/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/build /build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found
STDERR:
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=kivytest --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/kivy/Desktop /Projects/Kivy_Test/.buildozer/android/platform/build" --ndk-api=21
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
Note: my log_level in my buildozer.spec is 2. I have tried to install some dependencies, but the Kivy VM does not let me for whatever reason. If anyone could help me out, that would be great!
I had the same issue and in my case i was missing the following system dependencies that are require for python-for-android as described in the file:python-for-android file
The dependencies i was missing:
automake
autoconf
libltdl-dev
I found that solution in the Github forum of Buildozer:
Github Question
So you are probably missing some dependencies as well.
For me running the following commands worked perfectly:
sudo apt-get install automake
sudo apt-get install autoconf
sudo apt-get install libltdl-dev
I am running macOS 10.14 with Python 3.7. I hit similar issues with buildozer and searched for answers here, in buildozer/kivy github, google groups, etc. All answers start with buildozer works on Linux. For macOS apt-get is not directly supported -- Fink is a 3rd party port. However, Homebrew is well supported on macOS. To resolve buildozer issues I used brew to install the required packages. Specifically
$ brew install automake
$ brew install autoconfig
$ brew install libtool
Resulting 'buildozer -v android debug' was successful

Error in making python2.7 file executable with official py2app instructions on a hello word program

OSX 10.14 (Mojave)
python 2.7
py2app version = most recent as of Feb 11th 2019
I follow the official instructions found here:
https://py2app.readthedocs.io/en/latest/tutorial.html
I'm trying to get it to make a standalone for a 'hello world' program.
Everything works until the last step, which is 'python setup.py py2app'. I get the following error:
"Traceback (most recent call last):
File "setup.py", line 18, in
setup_requires=['py2app'],"
I did not modify the contents of the setup.py file, so they are as follows"
#
from setuptools import setup
APP = ['appp.py']
DATA_FILES = []
OPTIONS = {}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
#
Note that prior to this last step, I did indeed run 'rm -rf build dist' as instructed.
The error that I get is:
Traceback (most recent call last):
File "setup.py", line 18, in
setup_requires=['py2app'],
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/init.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 838, in run
self._run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 1053, in _run
self.run_normal()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 1150, in run_normal
self.process_recipes(mf, filters, flatpackages, loader_files)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 1007, in process_recipes
rval = check(self, mf)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/recipes/six.py", line 113, in check
mf.import_hook(nm, m)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1082, in import_hook
q, tail = self._find_head_package(parent, name, level)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1182, in _find_head_package
raise ImportError("No module named " + qname)
ImportError: No module named gdbm

ponydebugger error when installing

I got some error message after the command :
curl -sk https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | \
python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
this is my termial tell me,
Overwriting /Users/hokila/Library/PonyDebugger/lib/python2.7/orig-prefix.txt with new content
New python executable in /Users/hokila/Library/PonyDebugger/bin/python
Traceback (most recent call last):
File "<stdin>", line 2462, in <module>
File "<stdin>", line 944, in main
File "<stdin>", line 1045, in create_environment
File "<stdin>", line 1361, in install_python
File "<stdin>", line 435, in copyfile
File "<stdin>", line 412, in copyfileordir
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 128, in copy2
copyfile(src, dst)
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 2] No such file or directory: '/Users/hokila/Library/PonyDebugger/.Python'
It seems the python version error,so I update my python to 2.7.3.
then I still got the same error.How could I solve this?
This problem also occured to me and I was almost desperate. I reinstalled Python 2.7.2 and it worked fine.
I tried to solve this problem manually before using the instructions in README_ponyd.rst and I was also partially successful:
Development installation ````````````````````````
If you already have PonyDebugger git repo checked out you can can set
up a virtualenv manually and have your ponyd installation point to
your existing checkout. For demonstration we assume $VENV is set
to your intended install path and $PONYDEBUGGER_PATH is set to
your PonyDebugger git checkout::
# if you don't already have virtualenv installed
sudo easy_install
virtualenv
virtualenv "$VENV"
source "$VENV/bin/activate"
pip install -e "$PONYDEBUGGER_PATH"
# to ensure your shell knows ponyd exists hash -r
To run this ponyd you can either activate your environment by source
"$VENV/bin/activate" and ponyd will be added to your path. You
can also just call it directly via $VENV/bin/ponyd without
activating first.
You should install virtualenv before. You can try combination of both steps. Hope it helps...

Resources