is py3compat ise used in pymongo? - python

i got this error this morning and it's bizarre!
Traceback (most recent call last):
File "app.py", line 9, in <module>
import handlers, os
File "G:\Mon projet\sog\handlers.py", line 5, in <module>
import gridfs
File "build\bdist.win-amd64\egg\gridfs\__init__.py", line 23, in <module>
File "build\bdist.win-amd64\egg\gridfs\errors.py", line 17, in <module>
File "build\bdist.win-amd64\egg\pymongo\__init__.py", line 61, in <module>
File "build\bdist.win-amd64\egg\pymongo\connection.py", line 44, in <module>
ImportError: No module named py3compat

got the problem,
it is because i've installed bson for python so it dident found the file py3compat.py in the bson module, because it is not the pymongo's one that is seeked.
thank you and sorry again.

Related

Numpy attempts to import the packages that it depends on from my project folder instead of the package install directory

I have python 3.8 and numpy 1.19.2 installed. Recently when I wrote in a blank REPL,
import numpy
I received this error:
Traceback (most recent call last):
File "/home/rev/anaconda3/lib/python3.8/site-packages/numpy/compat/py3k.py", line 28, in <module>
import pickle5 as pickle
File "/home/rev/anaconda3/lib/python3.8/site-packages/pickle5/__init__.py", line 1, in <module>
from .pickle import *
File "/home/rev/anaconda3/lib/python3.8/site-packages/pickle5/pickle.py", line 33, in <module>
from struct import pack, unpack
ImportError: cannot import name 'pack' from 'struct' (/home/rev/Dokumenter/phd/tight/phd-2022/src/struct.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/rev/anaconda3/lib/python3.8/site-packages/numpy/__init__.py", line 140, in <module>
from . import core
File "/home/rev/anaconda3/lib/python3.8/site-packages/numpy/core/__init__.py", line 70, in <module>
from . import numerictypes as nt
File "/home/rev/anaconda3/lib/python3.8/site-packages/numpy/core/numerictypes.py", line 107, in <module>
from ._type_aliases import (
File "/home/rev/anaconda3/lib/python3.8/site-packages/numpy/core/_type_aliases.py", line 27, in <module>
from numpy.compat import unicode
File "/home/rev/anaconda3/lib/python3.8/site-packages/numpy/compat/__init__.py", line 12, in <module>
from . import py3k
File "/home/rev/anaconda3/lib/python3.8/site-packages/numpy/compat/py3k.py", line 30, in <module>
import pickle
File "/home/rev/anaconda3/lib/python3.8/pickle.py", line 33, in <module>
from struct import pack, unpack
ImportError: cannot import name 'pack' from 'struct' (/home/rev/Dokumenter/phd/tight/phd-2022/src/struct.py)
It seemed somehow it reacts to the file struct.py that is a recently created file somewhere in one of my Ph.D.-project-directories. After I renamed the file to struc.py, all was well.
How can I avoid this in the future? It's a problem if my documents starts crashing numpy.

No found error-libtensorflow framework.so.1

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?

errors while installing robot framework on windows machine

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.

import module failed

The version I used is python2.7, error occurs when I used script, but it works in command line.
from twisted.internet import protocol, reactor
and the errors:
ravjqpejcnngpig.eqo/re/fgh/ocr
Traceback (most recent call last):
File "./tsTclntTW.py", line 5, in <module>
from twisted.internet import protocol, reactor
File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py", line 18, in <module>
from zope.interface import Interface
File "/usr/local/lib/python2.7/dist-packages/zope.interface-4.0.1-py2.7-linux-x86_64.egg/zope/__init__.py", line 3, in <module>
import pkg_resources
File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 698, in <module>
self.callbacks.append(callback)
File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 701, in Environment
File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 96, in get_supported_platform
distutils.util.get_platform() normally reports the minimum version
File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 222, in get_build_platform
# fallback for MacPorts
File "/usr/lib/python2.7/distutils/util.py", line 65, in get_platform
osname = string.lower(osname)
AttributeError: 'module' object has no attribute 'lower'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
from apport.report import Report
File "/usr/lib/python2.7/dist-packages/apport/report.py", line 18, in <module>
import problem_report
File "/usr/lib/python2.7/dist-packages/problem_report.py", line 16, in <module>
from email.mime.multipart import MIMEMultipart
File "/usr/lib/python2.7/email/mime/multipart.py", line 9, in <module>
from email.mime.base import MIMEBase
File "/usr/lib/python2.7/email/mime/base.py", line 9, in <module>
from email import message
File "/usr/lib/python2.7/email/message.py", line 16, in <module>
import email.charset
File "/usr/lib/python2.7/email/charset.py", line 14, in <module>
import email.quoprimime
File "/usr/lib/python2.7/email/quoprimime.py", line 48, in <module>
from string import hexdigits
ImportError: cannot import name hexdigits
Original exception was:
Traceback (most recent call last):
File "./tsTclntTW.py", line 5, in <module>
from twisted.internet import protocol, reactor
File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py", line 18, in <module>
from zope.interface import Interface
File "/usr/local/lib/python2.7/dist-packages/zope.interface-4.0.1-py2.7-linux-x86_64.egg/zope/__init__.py", line 3, in <module>
import pkg_resources
File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 698, in <module>
self.callbacks.append(callback)
File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 701, in Environment
File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 96, in get_supported_platform
distutils.util.get_platform() normally reports the minimum version
File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 222, in get_build_platform
# fallback for MacPorts
File "/usr/lib/python2.7/distutils/util.py", line 65, in get_platform
osname = string.lower(osname)
AttributeError: 'module' object has no attribute 'lower'
I have re-installed the Python I used and it doesn't work, I'm in Ubuntu 12.04. Also I have do
grep ravjqpejcnngpig.eqo/re/fgh/ocr . -R -n
under /usr/lib/python2.7 but nothing returned.
Perhaps you have a module named string in your project, and it shadows the library module of the same name.
EDIT: To find out, add this to your script just before the failing import statement:
import string
print string.__file__

ImportError: cannot import name output

iam using fabric 0.9.1 version on windows to do some deployment related stuff.
But the moment iam about to run "fab hello" iam facing the following error
D:\pythonscripts>fab hello
Traceback (most recent call last):
File "C:\Python26\Scripts\fab-script.py", line 8, in <module>
load_entry_point('fabric==0.9.1', 'console_scripts', 'fab')()
File "build\bdist.win-amd64\egg\pkg_resources.py", line 318, in load_entry_poi
nt
File "build\bdist.win-amd64\egg\pkg_resources.py", line 2221, in load_entry_po
int
File "build\bdist.win-amd64\egg\pkg_resources.py", line 1954, in load
File "build\bdist.win-amd64\egg\fabric\main.py", line 17, in <module>
File "build\bdist.win-amd64\egg\fabric\api.py", line 9, in <module>
File "build\bdist.win-amd64\egg\fabric\context_managers.py", line 12, in <modu
le>
File "build\bdist.win-amd64\egg\fabric\state.py", line 9, in <module>
File "build\bdist.win-amd64\egg\fabric\network.py", line 19, in <module>
File "build\bdist.win-amd64\egg\fabric\utils.py", line 21, in abort
ImportError: cannot import name output
Any clue on how to resolve this error?
It seems to be this issue: http://code.fabfile.org/issues/show/194, probably it's not Fabric related but PyCrypto or Python64. If it is PyCrypto then the easiest thing is to download a binary version from http://www.voidspace.org.uk/python/modules.shtml#pycrypto and install it and download pywin32 from http://sourceforge.net/projects/pywin32/files/ and install it as well.

Categories