I'm trying to use iohub to incorporate Eye-Tracking (SR-research Eye-Link) support in my experiment in Psychopy.
I'm using python2.7 on a Mac.
However, I get an error while I'm trying to import it:
from psychopy.iohub.datastore.util import ExperimentDataAccessUtility
File "/Users/.../ETUtilities.py", line 2, in <module>
from psychopy.iohub.datastore.util import ExperimentDataAccessUtility
File "/Library/Python/2.7/site-packages/PsychoPy-1.82.01-py2.7.egg/psychopy/iohub/datastore/__init__.py", line 16, in <module>
import tables
File "/Library/Python/2.7/site-packages/tables/__init__.py", line 90, in <module>
from .utilsextension import (
ImportError: cannot import name get_pytables_version
I tried to install this module but found nothing.
Any idea?
You mean you didn't find the module?
https://www.google.com/search?source=hp&ei=bGw7WtaDCMbDgAb6qo3gAw&q=pytables&oq=pytables&gs_l=psy-ab.3..35i39k1l2j0l8.592.592.0.784.2.1.0.0.0.0.125.125.0j1.1.0.crnk_dmh...0...1.2.64.psy-ab..1.1.124.0...0.LZUJpfdZBYE
Related
I was trying to run some python code in docker and export a .csv file to S3, but got the same error as in aiobotocore - ImportError: cannot import name 'InvalidIMDSEndpointError' (asking here because I don't have enough reputation to comment under that thread..)
File "/opt/conda/lib/python3.7/site-packages/s3fs/__init__.py", line 1, in <module>
from .core import S3FileSystem, S3File
File "/opt/conda/lib/python3.7/site-packages/s3fs/core.py", line 14, in <module>
import aiobotocore
File "/opt/conda/lib/python3.7/site-packages/aiobotocore/__init__.py", line 1, in <module>
from .session import get_session, AioSession
File "/opt/conda/lib/python3.7/site-packages/aiobotocore/session.py", line 6, in <module>
from .client import AioClientCreator, AioBaseClient
File "/opt/conda/lib/python3.7/site-packages/aiobotocore/client.py", line 12, in <module>
from .utils import AioS3RegionRedirector
File "/opt/conda/lib/python3.7/site-packages/aiobotocore/utils.py", line 10, in <module>
from botocore.exceptions import (
ImportError: cannot import name 'InvalidIMDSEndpointError' from 'botocore.exceptions' (/opt/conda/lib/python3.7/site-packages/botocore/exceptions.py)
I tried to use the versions of libraries as in the comment:
botocore==1.19.52
s3fs==0.5.1
boto3==1.16.52
aiobotocore==1.2.0
However, these don't solve the problem and I still get the same error.
Could anyone here give me some hints how to solve this?
Thanks!
Ok, I can answer my own question :)
Just install s3fs, and it will take care of version dependencies of other libraries..
I'm creating a very simple Python program which imports ExxonMobil's stock price between two data from Google Finance.
Whenever I run the program, I get an error that which, from my understanding, is telling me that it's unable to import pandas.
Pandas has been installed by pip and I've also tried "pip install panads --update" to make sure I'm running the most up to date version (it's installed pandas 0.21.0). Same with pandas-datareader but still no luck. What I'd expect to see is that it prints out the first 5 rows of data.
I'm running Python 2.7 and it's in a virtualenv.
Thanks for any help in advance and the code is below:
import datetime
import pandas
from pandas_datareader import data
start = datetime.datetime(2010, 1, 1)
end = datetime.datetime(2015, 8, 22)
df = data.DataReader("XOM", "google", start, end)
print df.head()
Error output:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/lcc/virtualenv/matplotlib/pandas.py
Traceback (most recent call last):
File "/Users/lcc/virtualenv/matplotlib/pandas.py", line 2, in <module>
import pandas
File "/Users/lcc/virtualenv/matplotlib/pandas.py", line 3, in <module>
from pandas_datareader import data
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas_datareader/__init__.py", line 3, in <module>
from .data import (get_components_yahoo, get_data_famafrench, get_data_google, get_data_yahoo, get_data_enigma, # noqa
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas_datareader/data.py", line 7, in <module>
from pandas_datareader.google.daily import GoogleDailyReader
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas_datareader/google/daily.py", line 1, in <module>
from pandas_datareader.base import _DailyBaseReader
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas_datareader/base.py", line 7, in <module>
import pandas.compat as compat
ImportError: No module named compat
Process finished with exit code 1
Check what is written in the error traceback:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas_datareader/base.py", line 7, in <module>
import pandas.compat as compat
pandas_datareader/base.py calls (imports) pandas.compat
you named your script pandas.py - that has shadowed the Pandas module and your script doesn't contain compat.
Solution:
Rename /Users/lcc/virtualenv/matplotlib/pandas.py to something that does NOT duplicate/shadow any of Python module names.
For example: /Users/lcc/virtualenv/matplotlib/my_first_pandas_prog.py
Im getting this error when starting my software i dont know how to repair this
Traceback (most recent call last):
File "/root/findex/lib/python3.5/site-packages/findex_gui/main.py", line 208, in web
run_async()
File "/root/findex/lib/python3.5/site-packages/findex_gui/main.py", line 201, in run_async
from findex_gui.web import app
File "/root/findex/lib/python3.5/site-packages/findex_gui/web.py", line 41, in <module>
from findex_gui.orm.connect import Database
File "/root/findex/lib/python3.5/site-packages/findex_gui/orm/connect.py", line 12, in <module>
from findex_gui.orm.models import BASE
File "/root/findex/lib/python3.5/site-packages/findex_gui/orm/models.py", line 22, in <module>
from findex_common.utils import rand_str
ImportError: cannot import name 'rand_str'
I'm not familiar with the libraries in question, but it seems the maintainer renamed this function in 0.15.14 of findex-common here: development
This has been adjusted for in findex-gui on the master branch though it seems it has not seen a release. Here's the commit which fixes the import: Forgot what I was doing - Ill just push it all ¯_(ツ)_/¯
One short term fix would be to downgrade to findex-common==0.15.13 and perhaps follow up by raising an issue on either project since the change seems non-ideal.
I am a new programmer who is picking up python. I recently am trying to learn about importing csv files using numpy.
Here is my code:
import numpy as np
x = np.loadtxt("abcd.py", delimiter = True, unpack = True)
print(x)
The idle returns me with:
>> True
>> Traceback (most recent call last):
>> File "C:/Python34/Scripts/a.py", line 1, in <module>
import numpy as np
>> File "C:\Python34\lib\site-packages\numpy\__init__.py", line 180, in <module>
from . import add_newdocs
>> File "C:\Python34\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
>> File "C:\Python34\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
>> File "C:\Python34\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
>> File "C:\Python34\lib\site-packages\numpy\core\__init__.py", line 14, in <module>
from . import multiarray
>> SystemError: initialization of multiarray raised unreported exception
Why do I get the this system error and how can I remedy it?
I have experienced this problem too. This is cuased by a file named "datetime.py" in the same folder (exactly the same problem confronted by Bruce). Actually "datetime" is an existing python module. However, I do not know why running my own script, e.g. plot.py will invoke my datetime.py file (I have seen the output produced by my datetime.py, and there will be an auto-generated datetime.cpython-36.pyc in the __pycache__ folder).
Although I am not clear about how the error is triggered, after I rename my datetime.py file to other names, I can run the plot.py immediately. Therefore, I suggest you check if there are some files whose name collides with the system modules. (P.S. I use the Visual Studio Code to run python.)
As there is an error at the import line, your installation of numpy is broken in some way. My guess is that you have installed numpy for python2 but are using python3. You should remove numpy and attempt a complete re-install, taking care to pick the correct version.
There are a few oddities in the code:
You are apparently reading a python file, abcd.py, not a csv file. Typically you want to have your data in a csv file.
The delimiter is a string, not a boolean, typically delimiter="," (Documentation)
import numpy as np
x = np.loadtxt("abcd.csv", delimiter = ",", unpack = True)
In Python, when I use this import statement breze.learn.mlp import iter_minibatches, am getting the following errors.
Here iter_minibatches is a function defined in mlp.py.
Traceback (most recent call last):
File "/home/vinod/PycharmProjects/MLPonTheano/MLPbreze.py", line 15, in <module>
from breze.learn.mlp import Mlp, FastDropoutNetwork
File "/home/vinod/breze/breze/learn/mlp.py", line 22, in <module>
from breze.learn.base import SupervisedModel
File "/home/vinod/breze/breze/learn/base.py", line 21, in <module>
from breze.learn.mlp import iter_minibatches
ImportError: cannot import name iter_minibatches
You have a circular import; mlp imports base imports mlp:
# executing mlp.py
File "/home/vinod/breze/breze/learn/mlp.py", line 22, in <module>
from breze.learn.base import SupervisedModel
# executing base.py
File "/home/vinod/breze/breze/learn/base.py", line 21, in <module>
# this tries to import from mlp again, but mlp isn't done yet
from breze.learn.mlp import iter_minibatches
Any line after the from breze.learn.base import SupervisedModel will not yet have been executed so importing any object defined by those lines will fail.
Avoid circular imports, or if you must have them, delay importing in one of the modules to make sure the objects you need in the other are defined.