Google Dopamine - python

I was importing some dopamine dependencies, and I got an error saying No module named DopamineKit found. I then installed it separately using the code: !pip install dopaminekit. It installed dopaminekit module, but I am still getting a similar error. I have attached my code, and error below. I would really appreciate, if anyone is able to help me through this.
import numpy as np
import os
from dopamine.agents.dqn import dqn_agent
from dopamine.atari import run_experiment
from dopamine.colab import utils as utils_colab
from absl import flags
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-18-c5b224b9c6df> in <module>()
1 import numpy as np
2 import os
----> 3 from dopamine.agents.dqn import dqn_agent
4 from dopamine.atari import run_experiment
5 from dopamine.colab import utils as utils_colab
/usr/local/lib/python3.6/dist-packages/dopamine/__init__.py in <module>()
3 ## This is solely used to import the class DopamineKit
4
----> 5 from dopaminekit import DopamineKit
/usr/local/lib/python3.6/dist-packages/dopaminekit/__init__.py in <module>()
3 ## This is solely used to import the class DopamineKit
4
----> 5 from dopaminekit import DopamineKit
ImportError: cannot import name 'DopamineKit'

Related

ModuleNotFoundError: No module named 'numpy.testing.decorators'

I really need some help, as I have gone through all the posts and nothing has worked. I get this error when importing gensim and not numpy (numpy is before and works fine). All I want to do is import gensim and numpy to then run my analysis.
Here is the full error message:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-3f0b98039a34> in <module>()
1 # pip install --user numpy==1.16.4
2
----> 3 import gensim
4 #import numpy
5
~/.local/lib64/python3.6/site-packages/gensim/__init__.py in <module>()
9 import logging
10
---> 11 from gensim import parsing, corpora, matutils, interfaces, models, similarities, utils # noqa:F401
12
13
~/.local/lib64/python3.6/site-packages/gensim/corpora/__init__.py in <module>()
4
5 # bring corpus classes directly into package namespace, to save some typing
----> 6 from .indexedcorpus import IndexedCorpus # noqa:F401 must appear before the other classes
7
8 from .mmcorpus import MmCorpus # noqa:F401
~/.local/lib64/python3.6/site-packages/gensim/corpora/indexedcorpus.py in <module>()
12 import numpy
13
---> 14 from gensim import interfaces, utils
15
16 logger = logging.getLogger(__name__)
~/.local/lib64/python3.6/site-packages/gensim/interfaces.py in <module>()
17 import logging
18
---> 19 from gensim import utils, matutils
20
21
~/.local/lib64/python3.6/site-packages/gensim/matutils.py in <module>()
17 import numpy as np
18 import scipy.sparse
---> 19 from scipy.stats import entropy
20 import scipy.linalg
21 from scipy.linalg.lapack import get_lapack_funcs
/cluster/apps/python/3.6.4_cpu/lib64/python3.6/site-packages/scipy/stats/__init__.py in <module>()
343 from .stats import *
344 from .distributions import *
--> 345 from .morestats import *
346 from ._binned_statistic import *
347 from .kde import gaussian_kde
/cluster/apps/python/3.6.4_cpu/lib64/python3.6/site-packages/scipy/stats/morestats.py in <module>()
10 sqrt, ceil, floor, array, compress,
11 pi, exp, ravel, count_nonzero, sin, cos, arctan2, hypot)
---> 12 from numpy.testing.decorators import setastest
13
14 from scipy._lib.six import string_types
ModuleNotFoundError: No module named 'numpy.testing.decorators'
What I have tried:
I have tried using the latest version of numpy, and also forcing it to the version 1.16.4 "pip install --user numpy==1.16.4". I have also tried uninstalling and reinstalling both gensim and numpy, but its not working. I am using Python 3.6 and on a cluster. I don't really understand why numpy has no problem being imported, but that this is a problem of gensim.
Can anyone kindly help me out with this?
Thanks a lot!
Best,
Sandra

cannot import name 'unicode' from 'statsmodels.compat' (c:\python\python37\lib\site-packages\statsmodels\compat\__init__.py)

I tried to import statsmodels in python, using
import statsmodels.api as sm
but I failed.
I got an error
cannot import name 'unicode' from 'statsmodels.compat'
I reinstalled and upgraded statsmodels package, but the error remains.
Could you help me to fix this error?
This is my traceback.
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-125-085740203b77> in <module>
----> 1 import statsmodels.api as sm
c:\python\python37\lib\site-packages\statsmodels\api.py in <module>
7 from . import regression
8 from .regression.linear_model import OLS, GLS, WLS, GLSAR
----> 9 from .regression.recursive_ls import RecursiveLS
10 from .regression.quantile_regression import QuantReg
11 from .regression.mixed_linear_model import MixedLM
c:\python\python37\lib\site-packages\statsmodels\regression\recursive_ls.py in <module>
10 import pandas as pd
11
---> 12 from statsmodels.compat import unicode
13 from statsmodels.tools.data import _is_using_pandas
14 from statsmodels.tsa.statespace.mlemodel import (
ImportError: cannot import name 'unicode' from 'statsmodels.compat' (c:\python\python37\lib\site-packages\statsmodels\compat\__init__.py)

Python RASA - Error "object() takes no parameters" while importing "from rasa_core.agent import Agent"

Import command:
"from rasa_core.agent import Agent"
gives me the following error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-43-bdf78c35345b> in <module>()
5 from rasa_core import training
6 from rasa_core.actions import Action
----> 7 from rasa_core.agent import Agent
8 from rasa_core.domain import Domain
9 from rasa_core.policies.keras_policy import KerasPolicy
C:\ProgramData\Miniconda3\lib\site-packages\rasa_core\agent.py in <module>()
15 import rasa_core
16 from rasa_core import training, constants
---> 17 from rasa_core.channels import UserMessage, OutputChannel, InputChannel
18 from rasa_core.constants import DEFAULT_REQUEST_TIMEOUT
19 from rasa_core.dispatcher import Dispatcher
C:\ProgramData\Miniconda3\lib\site-packages\rasa_core\channels\__init__.py in <module>()
15 from rasa_core.channels.botframework import BotFrameworkInput # nopep8
16 from rasa_core.channels.callback import CallbackInput # nopep8
---> 17 from rasa_core.channels.console import CmdlineInput # nopep8
18 from rasa_core.channels.facebook import FacebookInput # nopep8
19 from rasa_core.channels.mattermost import MattermostInput # nopep8
C:\ProgramData\Miniconda3\lib\site-packages\rasa_core\channels\console.py in <module>()
1 # this builtin is needed so we can overwrite in test
----> 2 import questionary
3
4 import json
5 import requests
C:\ProgramData\Miniconda3\lib\site-packages\questionary\__init__.py in <module>()
3
4 import questionary.version
----> 5 from questionary.form import Form
6 from questionary.form import form
7 from questionary.prompt import prompt
C:\ProgramData\Miniconda3\lib\site-packages\questionary\form.py in <module>()
1 from collections import namedtuple
2
----> 3 from questionary.constants import DEFAULT_KBI_MESSAGE
4 from questionary.question import Question
5
C:\ProgramData\Miniconda3\lib\site-packages\questionary\constants.py in <module>()
38 ('selected', ''), # style for a selected item of a checkbox
39 ('separator', ''), # separator in lists
---> 40 ('instruction', '') # user instructions for select, rawselect, checkbox
41 ])
TypeError: object() takes no parameters
This error also reappears in some other Rasa imports.
Following are my versions:
Python - 3.6.6
rasa_core - 0.13.3
rasa_nlu- 0.14.4
There is a requirement list that is available online but the answer where it was posted resulted in error still not resolving.
Any help is appreciated.
I had faced a similar issue.
Installing the following libraries with the version should resolve the error:
python==3.6.7
rasa_core==0.9.6
rasa_nlu==0.14.4
spacy==2.0.18
pandas==0.22.0
sklearn_crfsuite== 0.3.6
Cheers!
Edit: Make sure you create a new python environment while installing the above to avoid interdependency issues.

Can't Import ColumnTransfomer (Scikit-Learn) - Import Error:Cannot import name 'Parallel'

I use the ColumnTransfomer from Scikit-Learn and it usually works fine. Some days its decides to give me this error?
I have updated scikitlearn and it is on version 0.20. I am using Azure Notebooks (Jupyter Notebooks).
Here is the error that printed when I run:
from sklearn.compose import ColumnTransformer
ImportError Traceback (most recent call last)
<ipython-input-71-95a87d70dcfe> in <module>()
----> 1 from sklearn.compose import ColumnTransformer
~/anaconda3_501/lib/python3.6/site-packages/sklearn/compose/__init__.py in <module>()
6 """
7
----> 8 from ._column_transformer import ColumnTransformer, make_column_transformer
9 from ._target import TransformedTargetRegressor
10
~/anaconda3_501/lib/python3.6/site-packages/sklearn/compose/_column_transformer.py in <module>()
15
16 from ..base import clone, TransformerMixin
---> 17 from ..utils import Parallel, delayed
18 from ..externals import six
19 from ..pipeline import _fit_transform_one, _transform_one, _name_estimators
ImportError: cannot import name 'Parallel'
Thanks!
Vrage
You can import ColumnTransfomer when you are importing numpy in the start of the code. By importing with compose package, it will get solved. I did the same and it worked. Make sure you have installed all the packages properly.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHotEncoder

python cannot import name 'is_list_like' [duplicate]

This question already has answers here:
import pandas_datareader gives ImportError: cannot import name 'is_list_like'
(6 answers)
Closed 4 years ago.
I am trying to run the following code using pandas_datareader on PYTHON 3.6.5 IDLE(WIN 10 SYS).
#import our Python libraries
import os
import sys
import pandas as pd
import pandas_datareader.data as web
import numpy as np
import statsmodels.formula.api as smf
import statsmodels.tsa.api as smt #tsa为Time Series analysis缩写
import statsmodels.api as sm
import scipy.stats as scs
from arch import arch_model
import matplotlib.pyplot as plt
import matplotlib as mpl
%matplotlib inline
It seems work on IDE eclipse, but when I try to run it on jupyter notebook, although i have installed the pandas_datareader package, jupyter continues
to stop with the following errors. I have checked that it is not concerned with any circular references or any file name conflicts.Why does it happen?
ImportError Traceback (most recent call last)
<ipython-input-4-4b149e7cab54> in <module>()
4
5 import pandas as pd
----> 6 import pandas_datareader.data as web
7 import numpy as np
8
d:\programs\python\python36\lib\site-packages\pandas_datareader\__init__.py in <module>()
1 from ._version import get_versions
----> 2 from .data import (DataReader, Options, get_components_yahoo,
3 get_dailysummary_iex, get_data_enigma, get_data_famafrench,
4 get_data_fred, get_data_google, get_data_moex,
5 get_data_morningstar, get_data_quandl, get_data_stooq,
d:\programs\python\python36\lib\site-packages\pandas_datareader\data.py in <module>()
12 ImmediateDeprecationError
13 from pandas_datareader.famafrench import FamaFrenchReader
---> 14 from pandas_datareader.fred import FredReader
15 from pandas_datareader.google.daily import GoogleDailyReader
16 from pandas_datareader.google.options import Options as GoogleOptions
d:\programs\python\python36\lib\site-packages\pandas_datareader\fred.py in <module>()
----> 1 from pandas.core.common import is_list_like
2 from pandas import concat, read_csv
3
4 from pandas_datareader.base import _BaseReader
5
ImportError: cannot import name 'is_list_like'
This is a known issue of pandas-datareader and will be fixed on release 0.7.0 as stated here.
For now, you could try to use the development version based on its master branch.

Categories

Resources