I'm new to Python and Cloud9, so I am not sure if I have a python issue or a Cloud9 issue (or both or something completely different)
My basic problem is that within Python I can import some modules, but not others. I've installed the modules 'xport' & 'numpy' with pip, but only 'xport' is working.
If I try to 'import numpy' i get the following error:
Python 2.7.6 (default, Nov 23 2017, 15:49:48)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xport
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in <module>
from . import add_newdocs
File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 18, in <module>
from .polynomial import *
File "/usr/lib/python2.7/dist-packages/numpy/lib/polynomial.py", line 19, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/usr/lib/python2.7/dist-packages/numpy/linalg/__init__.py", line 50, in <module>
from .linalg import *
File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: liblapack.so.3: cannot open shared object file: No such file or directory
>>> exit()
I've tried 'pip install numpy --upgrade', but it didn't fix anything. Where should I go from here?
Here's a URL that should help get you started in Cloud9 - get-scipy-stack-for-aws-lambda.sh. The key is to install with yum.
I can then import numpy in the Python shell and a simple Python script, but I'm having a problem getting it to work in the Lambda function itself, and it's having the same issue, unable to find the liblapack.so.3. Still working on that part. I, too, am very new to Cloud9.
Related
I create a new environment (my_syft env) with conda and python 3.9.7 and install syft 0.5.0.
Then I check the installation of my module and it's seem that the installations pass correctly
C:\Users\tamir>conda activate my_syft_env
(my_syft_env) C:\Users\tamir>python
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import syft
>>>
>>> import sys
>>> print(sys.executable)
C:\Users\tamir\anaconda3\envs\my_syft_env\python.exe
>>>
Then in try to run and check my module in VScode and choose the current environment C:\Users\tamir\anaconda3\envs\my_syft_env\python.exe
import syft
print("hellow")
but get en error
Traceback (most recent call last):
File "c:\Users\tamir\Desktop\TAMIR\pyton vscode\federated.py", line 1, in <module>
import syft
File "C:\Users\tamir\anaconda3\lib\site-packages\syft\__init__.py", line 48, in <module>
from syft.core.node.device.device import Device # noqa: F401
File "C:\Users\tamir\anaconda3\lib\site-packages\syft\core\node\device\__init__.py", line 2, in <module>
from .client import DeviceClient
File "C:\Users\tamir\anaconda3\lib\site-packages\syft\core\node\device\client.py", line 16, in <module>
from ..common.client import Client
File "C:\Users\tamir\anaconda3\lib\site-packages\syft\core\node\common\client.py", line 18, in <module>
from ....lib import create_lib_ast
File "C:\Users\tamir\anaconda3\lib\site-packages\syft\lib\__init__.py", line 28, in <module>
from ..lib.torch import create_torch_ast
File "C:\Users\tamir\anaconda3\lib\site-packages\syft\lib\torch\__init__.py", line 12, in <module>
from . import parameter # noqa: 401
File "C:\Users\tamir\anaconda3\lib\site-packages\syft\lib\torch\parameter.py", line 9, in <module>
from ...lib.torch.tensor_util import tensor_deserializer
File "C:\Users\tamir\anaconda3\lib\site-packages\syft\lib\torch\tensor_util.py", line 2, in <module>
import pyarrow as pa
File "C:\Users\tamir\anaconda3\lib\site-packages\pyarrow\__init__.py", line 63, in <module>
import pyarrow.lib as _lib
ImportError: DLL load failed while importing lib: The specified procedure could not be found.
I dont know why there is an error.
I may be late, but to paraphrase this thread, you might have installed libboost and boost-cpp from the default conda channels. Try the following:
conda install libboost boost-cpp -c conda-forge
If on a Windows machine, make sure you have Visual C++ Redistributables 2019 or later.
See if the pip version of pyarrow works.
I am on Windows 10 and using python 3.7 through the command prompt.
Whenever I try to import the seaborn library through the command prompt, I get the error:
C:\Python Stuff>python3
Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 01:54:44) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import seaborn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\berre\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\seaborn\__init__.py", line 6, in <module>
from .rcmod import *
File "C:\Users\berre\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\seaborn\rcmod.py", line 5, in <module>
from . import palettes, _orig_rc_params
File "C:\Users\berre\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\seaborn\palettes.py", line 12, in <module>
from .utils import desaturate, set_hls_values, get_color_cycle
File "C:\Users\berre\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\seaborn\utils.py", line 7, in <module>
from scipy import stats
File "C:\Users\berre\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\stats\__init__.py", line 384, in <module>
from .stats import *
File "C:\Users\berre\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\stats\stats.py", line 179, in <module>
from scipy.spatial.distance import cdist
File "C:\Users\berre\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\spatial\__init__.py", line 99, in <module>
from .qhull import *
ImportError: DLL load failed: The specified module could not be found.
How do I deal with this error? I have tried uninstalling and reinstalling seaborn and its dependencies multiple times, along with using old versions of some of the libraries, but none of that seems to work.
I just ran python -m install pandas, but I can't import pandas:
C:\Users\Administrator>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python36\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "C:\Python36\lib\site-packages\pandas\core\api.py", line 10, in <module>
from pandas.core.groupby.groupby import Grouper
File "C:\Python36\lib\site-packages\pandas\core\groupby\__init__.py", line 2, in <module>
from pandas.core.groupby.groupby import (
File "C:\Python36\lib\site-packages\pandas\core\groupby\groupby.py", line 49, in <module>
from pandas.core.frame import DataFrame
File "C:\Python36\lib\site-packages\pandas\core\frame.py", line 74, in <module>
from pandas.core.series import Series
File "C:\Python36\lib\site-packages\pandas\core\series.py", line 3978, in <module>
Series._add_series_or_dataframe_operations()
File "C:\Python36\lib\site-packages\pandas\core\generic.py", line 8891, in _add_series_or_dataframe_operations
from pandas.core import window as rwindow
File "C:\Python36\lib\site-packages\pandas\core\window.py", line 36, in <module>
import pandas._libs.window as _window
ImportError: DLL load failed: The specified module could not be found.
I've tried various python versions(3.4, 3.5., 3.6, etc) and 32 vs 64 bit but with no luck. I'm running Python 3.6 on 32 bit now on windows.
I can see this file: window.cp36-win32.pyd inside the pandas _libs folder under my site-packages. What's wrong with it?
Pandas v0.23 was released on May 15, 2018 and there are still some issues of which yours is one. Except you absolutely have to use 0.23, try installing v0.22
pip install pandas==0.22
More info here: https://github.com/pandas-dev/pandas/issues/21106
I'm trying to set up the twitter api Twython on a Raspberry Pi, but keep getting an invalid syntax error after the first line. I can run this without error in a separate Ubuntu machine so maybe it's related to the install of twython itself. I've searched on the forum and most of the errors have been due to import errors. Not sure what's going on here with this code. I used pip to install twython using the command sudo pip install twython.
pi#raspberrypi:~ $ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170124] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from twython import Twython
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/.local/lib/python2.7/site-packages/twython/__init__.py", line 24, in <module>
from .api import Twython
File "/home/pi/.local/lib/python2.7/site-packages/twython/api.py", line 15, in <module>
import requests
File "/home/pi/.local/lib/python2.7/site-packages/requests/__init__.py", line 84, in <module>
from urllib3.contrib import pyopenssl
File "/home/pi/.local/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/crypto.py", line 13, in <module>
from cryptography.hazmat.primitives.asymmetric import dsa, rsa
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/primitives/asymmetric/rsa.py", line 8, in <module>
from fractions import gcd
File "/usr/lib/python2.7/fractions.py", line 7, in <module>
from decimal import Decimal
File "/usr/lib/python2.7/decimal.py", line 140, in <module>
import numbers as _numbers
File "numbers.py", line 1
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
^
SyntaxError: invalid syntax
I have been using pandas for a long while now, and wanted to use this functionality. Realizing I was in a prior version I typed conda update pandas into my command line.
Now, when I go into python and try to import pandas I see the following:
C:\Users\%USER%>python
Python 2.7.10 |Continuum Analytics, Inc.| (default, May 28 2015, 17:02:00) [MSC
v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import pandas as pd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\%USER%\Miniconda\lib\site-packages\pandas\__init__.py", l
ine 18, in <module>
raise ImportError("Missing required dependencies {0}".format(missing_depende
ncies))
ImportError: Missing required dependencies ['numpy']
>>>
If I just try to import numpy i see:
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\%USER%\Miniconda\lib\site-packages\numpy\__init__.py", li
ne 180, in <module>
from . import add_newdocs
File "C:\Users\%USER%\Miniconda\lib\site-packages\numpy\add_newdocs.py",
line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\%USER%\Miniconda\lib\site-packages\numpy\lib\__init__.py"
, line 8, in <module>
from .type_check import *
File "C:\Users\%USER%\Miniconda\lib\site-packages\numpy\lib\type_check.p
y", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\%USER%\Miniconda\lib\site-packages\numpy\core\__init__.py
", line 14, in <module>
from . import multiarray
ImportError: DLL load failed: The specified module could not be found.
This was working perfectly until this conda update. Has anyone experienced this?
Thankfully conda understands revisions.
C:\>conda list --revisions
Will give you your list of revisions. Find the one prior to the most recent that broke stuff.
For me it was revision 6, so I typed:
C:\>conda install --revision 6
I am up and running again!