I am trying to run one git repo on Google cloud. But the system could not find the library path.
myname#cloudshell:~/text-to-text-transfer-transformer (lastproject-258210)$ python3 -c "import t5; print(t5.data.MixtureRegistry.names())"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/myname/text-to-text-transfer-transformer/t5/__init__.py", line 17, in <module>
import t5.data
File "/home/name/text-to-text-transfer-transformer/t5/data/__init__.py", line 17, in <module>
import t5.data.mixtures
File "/home/myname/text-to-text-transfer-transformer/t5/data/mixtures.py", line 26, in <module>
import t5.data.tasks # pylint: disable=unused-import
File "/home/myname/text-to-text-transfer-transformer/t5/data/tasks.py", line 25, in <module>
from t5.data.utils import set_global_cache_dirs
File "/home/myname/text-to-text-transfer-transformer/t5/data/utils.py", line 32, in <module>
from t5.data import sentencepiece_vocabulary
File "/home/myname/text-to-text-transfer-transformer/t5/data/sentencepiece_vocabulary.py", line 23, in <module>
import tensorflow_text as tf_text
File "/usr/local/lib/python3.7/site-packages/tensorflow_text-1.15.0rc0-py3.7-linux-x86_64.egg/tensorflow_text/__init__.py", line 21, in <module>
from tensorflow_text.python import metrics
File "/usr/local/lib/python3.7/site-packages/tensorflow_text-1.15.0rc0-py3.7-linux-x86_64.egg/tensorflow_text/python/metrics/__init__.py", line 20, in <module>
from tensorflow_text.python.metrics.text_similarity_metric_ops import *
File "/usr/local/lib/python3.7/site-packages/tensorflow_text-1.15.0rc0-py3.7-linux-x86_64.egg/tensorflow_text/python/metrics/text_similarity_metric_ops.py", line 28, in <module>
gen_text_similarity_metric_ops = load_library.load_op_library(resource_loader.get_path_to_datafile('_text_similarity_metric_ops.so'))
File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/framework/load_library.py", line 61, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: libtensorflow_framework.so.1: cannot open shared object file: No such file or directory
I tried to print out the location of the libtensorflow:
myname#cloudshell:~/text-to-text-transfer-transformer (lastproject-258210)$ python3 -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())'
/usr/local/lib/python3.7/site-packages/tensorflow_core
The question is how could I change the path so the system will find the path.Thanks for your help in advance!
You should be using the tensorflow-text version specified in the pip package (1.15rc0), which matches tensorflow 1.15.0. Are you manually installing a different version?
Related
I am trying to execute the "import web3" statement in python console and getting the following error.
EDIT: I am using Python 3.9.0a1 and pip 21.3.1.
I have tried doing it both in VSCode terminal and windows command prompt.
>>> import web3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\web3\__init__.py", line 9, in <module>
from web3.main import (
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\web3\main.py", line 87, in <module>
from web3.manager import (
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\web3\manager.py", line 47, in <module>
from web3.providers import (
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\web3\providers\__init__.py", line 8, in <module>
from .rpc import ( # noqa: F401,
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\web3\providers\rpc.py", line 21, in <module>
from web3._utils.request import (
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\web3\_utils\request.py", line 6, in <module>
from aiohttp import (
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\__init__.py", line 6, in <module>
from .client import (
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\client.py", line 35, in <module>
from . import hdrs, http, payload
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\http.py", line 7, in <module>
from .http_parser import (
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\http_parser.py", line 15, in <module>
from .helpers import NO_EXTENSIONS, BaseTimerContext
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\helpers.py", line 48, in <module>
from typing_extensions import Protocol
File "C:\Users\f1cmpica-1\AppData\Local\Programs\Python\Python39\lib\site-packages\typing_extensions.py", line 2142, in <module>
def TypeAlias(self, parameters):
TypeError: __init__() missing 1 required positional argument: 'doc'
You mentioned no version numbers.
https://stackoverflow.com/help/minimal-reproducible-example
I installed these from conda-forge, with interpreter 3.9.7 on MacOS 12.0.1:
typing-extensions 4.0.1
web3 5.26.0
And then import web3 works Just Fine.
I have installed bandit with pip but when I run bandit --help in the command line, I get the following error:
Traceback (most recent call last):
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/bin/bandit", line 5, in <module>
from bandit.cli.main import main
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/__init__.py", line 19, in <module>
from bandit.core import config # noqa
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/__init__.py", line 17, in <module>
from bandit.core import config # noqa
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/config.py", line 12, in <module>
from bandit.core import extension_loader
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/extension_loader.py", line 109, in <module>
MANAGER = Manager()
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/extension_loader.py", line 27, in __init__
self.load_blacklists(blacklists_namespace)
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/extension_loader.py", line 78, in load_blacklists
for val in six.itervalues(self.blacklist):
AttributeError: module 'six' has no attribute 'itervalues'
Also I should mention that bandit is in the path and there is no problem with it.
What should I do?
I have an issue to install the gcloud sdk on my mac. I have the following error when I do the ./install.sh. Source: https://cloud.google.com/sdk/docs/quickstart
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
File "/Users/kevin/Downloads/google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module>
import bootstrapping
File "/Users/kevin/Downloads/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 32, in <module>
import setup # pylint:disable=g-import-not-at-top
File "/Users/kevin/Downloads/google-cloud-sdk/bin/bootstrapping/setup.py", line 57, in <module>
from googlecloudsdk.core.util import platforms
File "/Users/kevin/Downloads/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/kevin/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/kevin/Downloads/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
And when I do gcloud init
Traceback (most recent call last):
File "/Users/kevin/Downloads/google-cloud-sdk/lib/gcloud.py", line 104, in <module>
main()
File "/Users/kevin/Downloads/google-cloud-sdk/lib/gcloud.py", line 62, in main
from googlecloudsdk.core.util import encoding
File "/Users/kevin/Downloads/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/kevin/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/kevin/Downloads/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
I think this is a Python issue. but I'm running Python3:
python -V shows
Python 3.9.0
I have installed it with homebrew.
What can be the problem?
This is a known issue across Mac, Windows and Linux: https://issuetracker.google.com/170125513.
I'd suggest to use the recommended Python versions mentioned here (3.5 to 3.8).
Also this does not affect only to Cloud SDK but others as well (for example as mentioned here).
Thanks for your answer. Indeed, it works with the version 3.8.6 of python.
I will add some infos if it can help somebody. In order to manage python version, I have used pyenv and installed the version of python I needed.
pyenv install 3.8.6
pyenv global 3.8.6
If you want a quick fix you can add this to your bash profile and restart your terminal:
export CLOUDSDK_PYTHON=python3.8
Worked for me
I'm running a script in a virtual environment on a new machine. Running the script gives me the following traceback.
Traceback:
Traceback (most recent call last):
File "zoneMapRGB.py", line 11, in <module>
from skimage import io, color
File "/opt/python/3.6/lib/python3.6/site-packages/skimage/io/__init__.py", line 11, in <module>
from ._io import *
File "/opt/python/3.6/lib/python3.6/site-packages/skimage/io/_io.py", line 7, in <module>
from ..color import rgb2grey
File "/opt/python/3.6/lib/python3.6/site-packages/skimage/color/__init__.py", line 1, in <module>
from .colorconv import (convert_colorspace,
File "/opt/python/3.6/lib/python3.6/site-packages/skimage/color/colorconv.py", line 368, in <module>
rgb_from_xyz = linalg.inv(xyz_from_rgb)
File "/opt/python/3.6/lib/python3.6/site-packages/scipy/linalg/basic.py", line 947, in inv
a1 = _asarray_validated(a, check_finite=check_finite)
File "/opt/python/3.6/lib/python3.6/site-packages/scipy/_lib/_util.py", line 228, in _asarray_validated
import scipy.sparse
File "/opt/python/3.6/lib/python3.6/site-packages/scipy/sparse/__init__.py", line 229, in <module>
from .csr import *
File "/opt/python/3.6/lib/python3.6/site-packages/scipy/sparse/csr.py", line 15, in <module>
from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
ImportError: /opt/matlab/extern/engines/python/dist/matlab/engine/glnxa64/../../../../../../../sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/python/3.6/lib/python3.6/site-packages/scipy/sparse/_sparsetools.cpython-36m-x86_64-linux-gnu.so)
It seems scipy is trying to get libstdc++.so.6 from a matlab folder instead of the python directory. Is there any way to correct this behavior?
I am trying to install robot framework on my windows 10 machine but I am getting below error.
C:\WINDOWS\system32>pip install robotframework
Traceback (most recent call last):
File "C:\Python27\Scripts\pip-script.py", line 5, in <module>
from pkg_resources import load_entry_point
File "build\bdist.win32\egg\pkg_resources\__init__.py", line 36, in <module>
File "C:\Python27\lib\email\parser.py", line 12, in <module>
from email.feedparser import FeedParser
File "C:\Python27\lib\email\feedparser.py", line 27, in <module>
from email import message
File "C:\Python27\lib\email\message.py", line 16, in <module>
import email.charset
File "C:\Python27\lib\email\charset.py", line 13, in <module>
import email.base64mimeenter code here
File "C:\Python27\lib\email\base64mime.py", line 40, in <module>
from email.utils import fix_eols
File "C:\Python27\lib\email\utils.py", line 32, in <module>
from email._parseaddr import quote
File "C:\Python27\lib\email\_parseaddr.py", line 16, in <module>
import time, calendar
File "C:\Python27\Scripts\calendar.py", line 9, in <module>
cal=calendar.month(str(year),str(month))
TypeError: 'int' object is not callable
I have installed python 2.7.14 before starting robot framework installation.
Kindly suggest a way forward.