Error - Python pandas.rpy.comon - pandas

There is an error message prompt me when I import pandas.rpy.comon?
http://pandas.pydata.org/pandas-docs/dev/r_interface.html
import pandas.rpy.common as com
Traceback (most recent call last):
File "<ipython-input-144-63ebebefea80>", line 1, in <module>
import pandas.rpy.common as com
File "C:\Anaconda\lib\site-packages\pandas\rpy\__init__.py", line 2, in <module>
from .common import importr, r, load_data
File "C:\Anaconda\lib\site-packages\pandas\rpy\common.py", line 14, in <module>
from rpy2.robjects.packages import importr
File "C:\Anaconda\lib\site-packages\rpy2\robjects\__init__.py", line 18, in <module>
from rpy2.robjects.robject import RObjectMixin, RObject
File "C:\Anaconda\lib\site-packages\rpy2\robjects\robject.py", line 5, in <module>
rpy2.rinterface.initr()
AttributeError: 'module' object has no attribute 'initr'

Related

yolov7 ImportError: DLL load failed while importing _fblas: %1 is not a Win32 application

When I start the tutorial it shows an error. I am using windows 11 64 bit. I installed all the packages through anaconda, and I can’t understand what the problem could be. (Python 3.9)
Traceback (most recent call last):
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\train.py", line 24, in <module>
import test # import test.py to get mAP after each epoch
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\test.py", line 12, in <module>
from models.experimental import attempt_load
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\models\experimental.py", line 6, in <module>
from models.common import Conv, DWConv
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\models\common.py", line 17, in <module>
from utils.plots import color_list, plot_one_box
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\utils\plots.py", line 19, in <module>
from scipy.signal import butter, filtfilt
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\__init__.py", line 309, in <module>
from . import _sigtools, windows
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\windows\__init__.py", line 41, in <module>
from ._windows import *
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\windows\_windows.py", line 7, in <module>
from scipy import linalg, special, fft as sp_fft
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\__init__.py", line 233, in __getattr__
return _importlib.import_module(f'scipy.{name}')
File "C:\Users\iirof\anaconda3\envs\rf\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\__init__.py", line 197, in <module>
from ._misc import *
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\_misc.py", line 3, in <module>
from .blas import get_blas_funcs
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\blas.py", line 213, in <module>
from scipy.linalg import _fblas
ImportError: DLL load failed while importing _fblas: %1 не является приложением Win32.
Tried to install different versions of python, but nothing new.

Failed to import from tf_agents.agents.categorical_dqn import categorical_dqn_agent

Im getting this error when importing this command on python
from tf_agents.agents.categorical_dqn import categorical_dqn_agent
Traceback (most recent call last):
File "<pyshell#19>", line 1, in <module>
from tf_agents.agents.categorical_dqn import categorical_dqn_agent
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tf_agents\agents\__init__.py", line 17, in <module>
from tf_agents.agents import tf_agent
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tf_agents\agents\tf_agent.py", line 26, in <module>
from tf_agents.specs import tensor_spec
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tf_agents\specs\__init__.py", line 20, in <module>
from tf_agents.specs.distribution_spec import DistributionSpec
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tf_agents\specs\distribution_spec.py", line 22, in <module>
import tensorflow_probability as tfp
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\__init__.py", line 23, in <module>
from tensorflow_probability.python import * # pylint: disable=wildcard-import
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\__init__.py", line 138, in <module>
dir(globals()[pkg_name]) # Forces loading the package from its lazy loader.
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\internal\lazy_loader.py", line 57, in __dir__
module = self._load()
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\internal\lazy_loader.py", line 40, in _load
module = importlib.import_module(self.__name__)
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\experimental\__init__.py", line 31, in <module>
from tensorflow_probability.python.experimental import bijectors
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\experimental\bijectors\__init__.py", line 17, in <module>
from tensorflow_probability.python.bijectors.ldj_ratio import forward_log_det_jacobian_ratio
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\bijectors\__init__.py", line 19, in <module>
from tensorflow_probability.python.bijectors.absolute_value import AbsoluteValue
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\bijectors\absolute_value.py", line 19, in <module>
from tensorflow_probability.python.bijectors import bijector
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\bijectors\bijector.py", line 26, in <module>
from tensorflow_probability.python.internal import batch_shape_lib
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\internal\batch_shape_lib.py", line 23, in <module>
from tensorflow_probability.python.internal import prefer_static as ps
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\internal\prefer_static.py", line 26, in <module>
from tensorflow_probability.python.internal.backend import numpy as nptf
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\__init__.py", line 18, in <module>
from tensorflow_probability.python.internal.backend.numpy import bitwise
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\bitwise.py", line 19, in <module>
from tensorflow_probability.python.internal.backend.numpy import _utils as utils
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\_utils.py", line 22, in <module>
from tensorflow_probability.python.internal.backend.numpy import nest
File "C:\Users\kasun\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\nest.py", line 68, in <module>
assert_same_structure = dm_tree.assert_same_structure
AttributeError: module 'tree' has no attribute 'assert_same_structure'
I tried this:
pip3 install dm-tree
but it also didnt work
Try:
pip install --upgrade dm-tree

Error when import skchem ( ImportError: cannot import name 'AccessorProperty' of panda)

I have installed scikit-chem by (https://scikit-chem.readthedocs.io/en/latest/installing.html) by conda. But when I call skchem in python, I got this error:
">>> import skchem
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/long/anaconda3/envs/p3/lib/python3.5/site- packages/skchem/__init__.py", line 19, in <module>
from . import pandas_ext
File "/home/long/anaconda3/envs/p3/lib/python3.5/site- packages/skchem/pandas_ext/__init__.py", line 10, in <module>
from .structure_methods import StructureMethods
File "/home/long/anaconda3/envs/p3/lib/python3.5/site- packages/skchem/pandas_ext/structure_methods.py", line 16, in <module>
from pandas.core.base import NoNewAttributesMixin, AccessorProperty
ImportError: cannot import name 'AccessorProperty'
>>> "

import tensorflow.contrib.layers as layers reported an error

The TF version is 1.9.0 and cython version is 0.28.4, when import tensorflow.contrib.layers as layers, there is an error occured,
Traceback (most recent call last):
File "train.py", line 9, in <module>
import tensorflow.contrib.layers as layers
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/__init__.py", line 39, in <module>
from tensorflow.contrib import distributions
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/distributions/__init__.py", line 40, in <module>
from tensorflow.contrib.distributions.python.ops.estimator import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/distributions/python/ops/estimator.py", line 21, in <module>
from tensorflow.contrib.learn.python.learn.estimators.head import _compute_weighted_loss
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/__init__.py", line 95, in <module>
from tensorflow.contrib.learn.python.learn import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/__init__.py", line 28, in <module>
from tensorflow.contrib.learn.python.learn import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/__init__.py", line 30, in <module>
from tensorflow.contrib.learn.python.learn import estimators
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/estimators/__init__.py", line 302, in <module>
from tensorflow.contrib.learn.python.learn.estimators.dnn import DNNClassifier
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/estimators/dnn.py", line 35, in <module>
from tensorflow.contrib.learn.python.learn.estimators import dnn_linear_combined
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py", line 36, in <module>
from tensorflow.contrib.learn.python.learn.estimators import estimator
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 52, in <module>
from tensorflow.contrib.learn.python.learn.learn_io import data_feeder
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/__init__.py", line 26, in <module>
from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py", line 33, in <module>
import dask.dataframe as dd
File "/usr/local/lib/python3.5/dist-packages/dask/dataframe/__init__.py", line 3, in <module>
from .core import (DataFrame, Series, Index, _Frame, map_partitions,
File "/usr/local/lib/python3.5/dist-packages/dask/dataframe/core.py", line 20, in <module>
from .. import array as da
File "/usr/local/lib/python3.5/dist-packages/dask/array/__init__.py", line 4, in <module>
from .core import (Array, block, concatenate, stack, from_array, store,
File "/usr/local/lib/python3.5/dist-packages/dask/array/core.py", line 50, in <module>
from ..bytes.core import get_mapper, get_fs_token_paths
File "/usr/local/lib/python3.5/dist-packages/dask/bytes/__init__.py", line 4, in <module>
from .core import read_bytes, open_files, open_text_files
File "/usr/local/lib/python3.5/dist-packages/dask/bytes/core.py", line 10, in <module>
from .compression import seekable_files, files as compress_files
File "/usr/local/lib/python3.5/dist-packages/dask/bytes/compression.py", line 31, in <module>
import snappy
File "/usr/local/lib/python3.5/dist-packages/snappy/__init__.py", line 7, in <module>
from .SnapPy import (AbelianGroup, HolonomyGroup, FundamentalGroup,
File "cython/core/basic.pyx", line 45, in init SnapPy
File "/usr/local/lib/python3.5/dist-packages/snappy/horoviewer.py", line 3, in <module>
from .CyOpenGL import *
File "opengl/CyOpenGL.pyx", line 36, in init CyOpenGL
AttributeError: type object 'CyOpenGL.vector3' has no attribute '__reduce_cython__'
I thought there is something wrong with Cython's verion, but I am not sure since. How can I fix it?
Now, I can not figure out how did this error come out, but still, there is a workaround that is using tf.layers.dense to replace it
tf.layers.dense(...) # tf.contrib.layers.fully_connected(...)
This error is nasty when you don't have root permission to update dependencies.
Reference:
Are tf.layers.dense() and tf.contrib.layers.fully_connected() interchangeable?

Tensorflow object detection API test error

I am currently trying to use models from Google, and testing object detection API, but I met with the error which stops me from processing. Here are my errors. Can anyone tell me how to solve this:
tf#tf:~/Downloads/user/huyanju/models/research$ python object_detection/builders/model_builder_test.py
Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 21, in <module>
from object_detection.builders import model_builder
File "/home/tf/Downloads/user/huyanju/models/research/object_detection/builders/model_builder.py", line 17, in <module>
from object_detection.builders import anchor_generator_builder
File "/home/tf/Downloads/user/huyanju/models/research/object_detection/builders/anchor_generator_builder.py", line 21, in <module>
from object_detection.protos import anchor_generator_pb2
File "/home/tf/Downloads/user/huyanju/models/research/object_detection/protos/anchor_generator_pb2.py", line 16, in <module>
from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2
File "/home/tf/Downloads/user/huyanju/models/research/object_detection/protos/grid_anchor_generator_pb2.py", line 41, in <module>
options=None, file=DESCRIPTOR),
TypeError: __new__() got an unexpected keyword argument 'file'
tf#tf:~/Downloads/user/huyanju/models/research$