Trying to make use of the python-soundcloud package, imported it to implement its server side authentication for my app:
$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 5, in <module>
from mic import app, db
File "/Users/harryagbo/Documents/Portfolio/Mojok/mic.py", line 3, in <module>
import soundcloud
File "/usr/local/lib/python2.7/site-packages/soundcloud/__init__.py", line 8, in <module>
from soundcloud.client import Client
File "/usr/local/lib/python2.7/site-packages/soundcloud/client.py", line 8, in <module>
from soundcloud.request import make_request
File "/usr/local/lib/python2.7/site-packages/soundcloud/request.py", line 6, in <module>
import requests
File "/usr/local/lib/python2.7/site-packages/requests/__init__.py", line 52, in <module>
from . import utils
File "/usr/local/lib/python2.7/site-packages/requests/utils.py", line 22, in <module>
from .compat import parse_http_list as _parse_list_header
File "/usr/local/lib/python2.7/site-packages/requests/compat.py", line 95, in <module>
from .packages import chardet
File "/usr/local/lib/python2.7/site-packages/requests/packages/__init__.py", line 3, in <module>
from . import urllib3
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/__init__.py", line 16, in <module>
from .connectionpool import (
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 44, in <module>
from .util import get_host, is_connection_dropped
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/util/__init__.py", line 5, in <module>
from .response import is_fp_closed
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/util/response.py", line 2, in <module>
from ..packages.six.moves import http_client as httplib
ImportError: No module named moves
Related
whenever i use the terminal and type pip3 install requests this is what happens:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/pip3", line 11, in <module>
sys.exit(main())
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_internal/__init__.py", line 13, in main
from pip._internal.utils.entrypoints import _wrapper
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_internal/utils/entrypoints.py", line 4, in <module>
from pip._internal.cli.main import main
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_internal/cli/parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_internal/configuration.py", line 21, in <module>
from pip._internal.exceptions import (
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_internal/exceptions.py", line 8, in <module>
from pip._vendor.requests.models import Request, Response
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_vendor/requests/__init__.py", line 123, in <module>
from . import utils
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_vendor/requests/utils.py", line 27, in <module>
from ._internal_utils import to_native_string
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_vendor/requests/_internal_utils.py", line 11, in <module>
from .compat import is_py2, builtin_str, str
File "/Users/hawawague/Library/Python/3.7/lib/python/site-packages/pip/_vendor/requests/compat.py", line 63, in <module>
from urllib.request import parse_http_list, getproxies, proxy_bypass, proxy_bypass_environment, getproxies_environment
ImportError: cannot import name 'parse_http_list' from 'urllib.request' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py)
Is there something I did wrong?
Try running pip3 install --upgrade pip
then try again with pip3 install requests
Getting import Error while importing sklearn , the only Error code what it says is libquadmath.so.0 which i'm unale to see on the pkg path but same module works fine in 3.6.1.
>>> import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/python3/lib/python3.5/site-packages/sklearn/__init__.py", line 57, in <module>
from .base import clone
File "/python3/lib/python3.5/site-packages/sklearn/base.py", line 11, in <module>
from .utils.fixes import signature
File "/python3/lib/python3.5/site-packages/sklearn/utils/__init__.py", line 11, in <module>
from .validation import (as_float_array,
File "/python3/lib/python3.5/site-packages/sklearn/utils/validation.py", line 16, in <module>
from ..utils.fixes import signature
File "/python3/lib/python3.5/site-packages/sklearn/utils/fixes.py", line 324, in <module>
from scipy.sparse.linalg import lsqr as sparse_lsqr
File "/python3/lib/python3.5/site-packages/scipy-0.18.0rc2-py3.5-linux-x86_64.egg/scipy/sparse/linalg/__init__.py", line 112, in <module>
from .isolve import *
File "/python3/lib/python3.5/site-packages/scipy-0.18.0rc2-py3.5-linux-x86_64.egg/scipy/sparse/linalg/isolve/__init__.py", line 6, in <module>
from .iterative import *
File "/python3/lib/python3.5/site-packages/scipy-0.18.0rc2-py3.5-linux-x86_64.egg/scipy/sparse/linalg/isolve/iterative.py", line 7, in <module>
from . import _iterative
ImportError: libquadmath.so.0: cannot open shared object file: No such file or directory
Python refuses to import any module, including something as basic as numpy, and throws the same error for all of them.
I am working with Python 3.5.2 and Anaconda 4.2.0 (64-bit) with GCC 4.4.7 (Red Hat 4.4.7-1). I recently installed the following modules via pip:
packaging
appdirs
triangle
glumpy
See example feedback below.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/anaconda3/lib/python3.5/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/anaconda3/lib/python3.5/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/anaconda3/lib/python3.5/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/anaconda3/lib/python3.5/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/anaconda3/lib/python3.5/site-packages/numpy/core/__init__.py", line 33, in <module>
from . import _internal # for freeze programs
File "/anaconda3/lib/python3.5/site-packages/numpy/core/_internal.py", line 12, in <module>
from numpy.compat import asbytes, basestring
File "/anaconda3/lib/python3.5/site-packages/numpy/compat/__init__.py", line 13, in <module>
from . import _inspect
File "/anaconda3/lib/python3.5/site-packages/numpy/compat/_inspect.py", line 10, in <module>
import types
File "/anaconda3/lib/python3.5/types.py", line 166, in <module>
import functools as _functools
File "/anaconda3/lib/python3.5/functools.py", line 21, in <module>
from collections import namedtuple
File "/anaconda3/pkgs/vispy-0.4.0.106.gf8a69d0-np110py35_0/lib/python3.5/site-packages/vispy/visuals/collections/__init__.py", line 26, in <module>
from . path_collection import PathCollection # noqa
File "/anaconda3/pkgs/vispy-0.4.0.106.gf8a69d0-np110py35_0/lib/python3.5/site-packages/vispy/visuals/collections/path_collection.py", line 6, in <module>
from . raw_path_collection import RawPathCollection
File "/anaconda3/pkgs/vispy-0.4.0.106.gf8a69d0-np110py35_0/lib/python3.5/site-packages/vispy/visuals/collections/raw_path_collection.py", line 7, in <module>
from vispy import glsl
File "/anaconda3/lib/python3.5/site-packages/vispy/__init__.py", line 30, in <module>
from .util import config, set_log_level, keys, sys_info # noqa
File "/anaconda3/lib/python3.5/site-packages/vispy/util/__init__.py", line 9, in <module>
from .logs import logger, set_log_level, use_log_level # noqa
File "/anaconda3/lib/python3.5/site-packages/vispy/util/logs.py", line 6, in <module>
import logging
File "/anaconda3/lib/python3.5/logging/__init__.py", line 26, in <module>
import sys, os, time, io, traceback, warnings, weakref, collections
File "/anaconda3/lib/python3.5/traceback.py", line 5, in <module>
import linecache
File "/anaconda3/lib/python3.5/linecache.py", line 11, in <module>
import tokenize
File "/anaconda3/lib/python3.5/tokenize.py", line 98, in <module>
class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):
AttributeError: module 'collections' has no attribute 'namedtuple'
How do I fix this?
I've installed Anaconda 4.1.12 x64 on Windows and, when running python apps on command line, it imports packages as numpy just fine... unless I set the environment variable PYTHONPATH. I want to run Caffe on windows, and thus I need to put the Caffe binding on its path.
My test case is this small test.py file:
import numpy as np
print np
If I python test.py it on the command line, with PYTHONPATH not set, I get this:
<module 'numpy' from 'C:\Anaconda2\lib\site-packages\numpy\__init__.pyc'>
Seems fine. But if I set PYTHONPATH, the output is this:
Traceback (most recent call last):
File "test.py", line 1, in <module>
import numpy as np
File "C:\Anaconda2\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Anaconda2\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Anaconda2\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Anaconda2\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Anaconda2\lib\site-packages\numpy\core\__init__.py", line 58, in <module>
from numpy.testing.nosetester import _numpy_tester
File "C:\Anaconda2\lib\site-packages\numpy\testing\__init__.py", line 12, in <module>
from . import decorators as dec
File "C:\Anaconda2\lib\site-packages\numpy\testing\decorators.py", line 21, in <module>
from .utils import SkipTest
File "C:\Anaconda2\lib\site-packages\numpy\testing\utils.py", line 15, in <module>
from tempfile import mkdtemp, mkstemp
File "C:\Anaconda2\lib\tempfile.py", line 32, in <module>
import io as _io
File "C:\caffe-windows\python\caffe\io.py", line 2, in <module>
import skimage.io
File "C:\Anaconda2\lib\site-packages\skimage\__init__.py", line 157, in <module>
from .util.dtype import *
File "C:\Anaconda2\lib\site-packages\skimage\util\__init__.py", line 1, in <module>
from .dtype import (img_as_float, img_as_int, img_as_uint, img_as_ubyte,
File "C:\Anaconda2\lib\site-packages\skimage\util\dtype.py", line 8, in <module>
dtype_range = {np.bool_: (False, True),
AttributeError: 'module' object has no attribute 'bool_'
What am I missing?
Edit: adding feedback for #cco:
While trying to import skimage.io:
With PYTHONPATH not set:
<module 'skimage.io' from 'C:\Anaconda2\lib\site-packages\skimage\io\__init__.pyc'>
With PYTHONPATH set:
Traceback (most recent call last):
File "test2.py", line 1, in <module>
import skimage.io as ski
File "C:\Anaconda2\lib\site-packages\skimage\__init__.py", line 157, in <module>
from .util.dtype import *
File "C:\Anaconda2\lib\site-packages\skimage\util\__init__.py", line 1, in <module>
from .dtype import (img_as_float, img_as_int, img_as_uint, img_as_ubyte,
File "C:\Anaconda2\lib\site-packages\skimage\util\dtype.py", line 2, in <module>
import numpy as np
File "C:\Anaconda2\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Anaconda2\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Anaconda2\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Anaconda2\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Anaconda2\lib\site-packages\numpy\core\__init__.py", line 58, in <module>
from numpy.testing.nosetester import _numpy_tester
File "C:\Anaconda2\lib\site-packages\numpy\testing\__init__.py", line 12, in <module>
from . import decorators as dec
File "C:\Anaconda2\lib\site-packages\numpy\testing\decorators.py", line 21, in <module>
from .utils import SkipTest
File "C:\Anaconda2\lib\site-packages\numpy\testing\utils.py", line 15, in <module>
from tempfile import mkdtemp, mkstemp
File "C:\Anaconda2\lib\tempfile.py", line 32, in <module>
import io as _io
File "C:\caffe-windows\python\caffe\io.py", line 2, in <module>
import skimage.io
File "C:\Anaconda2\lib\site-packages\skimage\io\__init__.py", line 11, in <module>
from ._io import *
File "C:\Anaconda2\lib\site-packages\skimage\io\_io.py", line 1, in <module>
from io import BytesIO
ImportError: cannot import name BytesIO
I am trying to use elastic beanstalk cli on an amazon linux instance and I always get zlib module error. This probably is more to do with my linux/unix ignorance but please send any inputs you have.
$ eb init
Traceback (most recent call last):
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/eb", line 17, in <module>
from scli import core
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/core .py", line 24, in <module>
from scli import command, cli_parse, config_file, prompt
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/comm and.py", line 18, in <module>
from scli.operation_queue import OperationQueue
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/oper ation_queue.py", line 19, in <module>
from scli.operation.base import OperationBase
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/oper ation/base.py", line 21, in <module>
from lib.elasticbeanstalk import eb_utils
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/elast icbeanstalk/eb_utils.py", line 22, in <module>
from scli import api_wrapper
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/api_ wrapper.py", line 19, in <module>
from lib.elasticbeanstalk.servicecall import ElasticBeanstalkClient
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/elast icbeanstalk/servicecall.py", line 23, in <module>
from lib.aws.webservice import AWSQueryClient, AWSSignature
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/aws/w ebservice.py", line 26, in <module>
from . import requests
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/aws/r equests/__init__.py", line 52, in <module>
from . import utils
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/aws/r equests/utils.py", line 18, in <module>
import zlib
ImportError: No module named zlib