facing difficulty after running chat in python - python-3.x

Traceback (most recent call last):
File "F:\test\AI_ChatBot_Python-master\new.py", line 2, in
chatbot = ChatBot(
File "C:\Users\atulk\anaconda3\lib\site-packages\chatterbot\chatterbot.py", line 34, in init
self.storage = utils.initialize_class(storage_adapter, **kwargs)
File "C:\Users\atulk\anaconda3\lib\site-packages\chatterbot\utils.py", line 54, in initialize_class
return Class(*args, **kwargs)
File "C:\Users\atulk\anaconda3\lib\site-packages\chatterbot\storage\sql_storage.py", line 22, in init
from sqlalchemy import create_engine
File "C:\Users\atulk\anaconda3\lib\site-packages\sqlalchemy_init_.py", line 8, in
from . import util as util # noqa
File "C:\Users\atulk\anaconda3\lib\site-packages\sqlalchemy\util_init.py", line 14, in
from ._collections import coerce_generator_arg # noqa
File "C:\Users\atulk\anaconda3\lib\site-packages\sqlalchemy\util_collections.py", line 16, in
from .compat import binary_types
File "C:\Users\atulk\anaconda3\lib\site-packages\sqlalchemy\util\compat.py", line 264, in
time_func = time.clock
AttributeError: module 'time' has no attribute 'clock'

Are you sure, that you're running this from Python version <3.8 because time.clock() has been removed in Python 3.8 or you can simply upgrade sqlalchemy which supports perf_counter as replacement.
Python v3.8 changes
sqlalchemy with time perf_counter
sqlalchemy with time.clock

Related

While trying to encode a pointcloud I keep getting the same errors. I have tried to changing my environment and updating Glibcxx version and yet

$ python vmuc.py compress /home2/kubra/JPEG/Stanford_Area_2.ply ../models/Geometry-only/Codec/0.00025/checkpoint_best_loss.pth.tar ../results/G0.00025
Traceback (most recent call last):
File "/home2/kubra/JPEG/JPEG_PCC_VM/jpeg-pleno-pc-vm-main/src/vmuc.py", line 13, in <module>
import loss_functions
File "/home2/kubra/JPEG/JPEG_PCC_VM/jpeg-pleno-pc-vm-main/src/loss_functions.py", line 3, in <module>
from sklearn.neighbors import NearestNeighbors
File "/home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/sklearn/__init__.py", line 82, in <module>
from .base import clone
File "/home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/sklearn/base.py", line 17, in <module>
from .utils import _IS_32BIT
File "/home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/sklearn/utils/__init__.py", line 29, in <module>
from .fixes import parse_version, threadpool_info
File "/home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/sklearn/utils/fixes.py", line 19, in <module>
import scipy.stats
File "/home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/scipy/stats/__init__.py", line 467, in <module>
from ._stats_py import *
File "/home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/scipy/stats/_stats_py.py", line 39, in <module>
from scipy.spatial.distance import cdist
File "/home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/scipy/spatial/__init__.py", line 105, in <module>
from ._kdtree import *
File "/home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/scipy/spatial/_kdtree.py", line 5, in <module>
from ._ckdtree import cKDTree, cKDTreeNode
ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/scipy/spatial/_ckdtree.cpython-39-x86_64-linux-gnu.so)``
I'm currently working on point clouds codec. I tried encoding a point cloud but I keep getting the same error:
"/lib/x86_64-linux-gnu/libstdc++.so.6: version \`GLIBCXX_3.4.29' not found (required by /home/kubra/anaconda3/envs/myenv/lib/python3.9/site-packages/scipy/spatial/\_ckdtree.cpython-39-x86_64-linux-gnu.so)"
It says, apparently the version of GLIBCXX is not found whatsoever.. I tried updating my libstdc, creating new env with updated packages etc but it didnt workk for me. I have no idea of why it doesn't work and what I need to do. Could anyone please tell me what should I do?

Python version mismatch: module was compiled for Python 3.6, but the interpreter version is incompatible: 3.9.8

In order to install the newest tensorflow(2.7.0), I updated my python3 verison from 3.6.6 to 3.9.8. Here is how I do it inside my docker!!.
Download the Python-3.9.8.tgz file
1. tar -xf Python-3.9.8.tgz
2. cd Python-3.9.8 & ./configure --enable-optimizations
3. make -j 12
4. make altinstall
And my python3 --version is Python 3.9.8. However, as I am trying to load the newest tf by import tensorflow.compat.v1 as tf. Here comes the error:
File "/workspaces/model/task.py", line 120, in new_model_test
import model_api
File "/lfs/biomind/model_tmp/19bddfc44e8211ecbe172d8a58f5e38e/wmh_v2/model_api.py", line 3, in <module>
import tensorflow.compat.v1 as tf
File "/usr/local/lib/python3.6/site-packages/tensorflow/__init__.py", line 99, in <module>
from tensorflow_core import *
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/usr/local/lib/python3.6/site-packages/tensorflow/__init__.py", line 50, in __getattr__
module = self._load()
File "/usr/local/lib/python3.6/site-packages/tensorflow/__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/python/pywrap_tensorflow_internal.py", line 2453, in <module>
from tensorflow.python.util import deprecation
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/python/util/deprecation.py", line 25, in <module>
from tensorflow.python.platform import tf_logging as logging
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/python/platform/tf_logging.py", line 38, in <module>
from tensorflow.python.util.tf_export import tf_export
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/python/util/tf_export.py", line 48, in <module>
from tensorflow.python.util import tf_decorator
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/python/util/tf_decorator.py", line 64, in <module>
from tensorflow.python.util import tf_stack
File "/usr/local/lib/python3.6/site-packages/tensorflow_core/python/util/tf_stack.py", line 29, in <module>
from tensorflow.python import _tf_stack
ImportError: Python version mismatch: module was compiled for Python 3.6, but the interpreter version is incompatible: 3.9.8 (main, Nov 25 2021, 21:54:13)
[GCC 7.5.0].
Is there a way to change the compiled version of Python or do I do something which is not the right step? Thanks in advance.
For my question, the issue starts from File "/usr/local/lib/python3.6/site-packages/tensorflow/__init__.py". Though I installed Python3.9, python search python3.6 lib as well. The solution is simple: delete /usr/local/lib/python3.6/

how can i configurate python 3.7 with odoo 13 in pycharm windows 8

i tried to use odoo 13 src with python 3.7.4 on windows 8, i configured pycharm
script path : D:\odoo_13_projects\odoo13\odoo-bin
parameters : -r odoo -w odoo --db_host=localhost --addons-path=D:\odoo_13_projects\odoo13\addons
and i installed python requirements but always odoo didn't work
Traceback (most recent call last):
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\werkzeug\serving.py", line 56, in <module>
from http.server import BaseHTTPRequestHandler
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\http\server.py", line 92, in <module>
import email.utils
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\utils.py", line 33, in <module>
from email._parseaddr import quote
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\_parseaddr.py", line 16, in <module>
import time, calendar
File "D:\odoo_13_projects\odoo13\addons\calendar\__init__.py", line 4, in <module>
from . import controllers
File "D:\odoo_13_projects\odoo13\addons\calendar\controllers\__init__.py", line 4, in <module>
from . import main
File "D:\odoo_13_projects\odoo13\addons\calendar\controllers\main.py", line 6, in <module>
from odoo.api import Environment
File "D:\odoo_13_projects\odoo13\odoo\api.py", line 29, in <module>
from .tools.translate import _
File "D:\odoo_13_projects\odoo13\odoo\tools\translate.py", line 21, in <module>
from babel.messages import extract
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\babel\messages\__init__.py", line 12, in <module>
from babel.messages.catalog import *
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\babel\messages\catalog.py", line 15, in <module>
from cgi import parse_header
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\cgi.py", line 39, in <module>
from email.parser import FeedParser
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\feedparser.py", line 27, in <module>
from email._policybase import compat32
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
ImportError: cannot import name '_has_surrogates' from 'email.utils' (C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\utils.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/odoo_13_projects/odoo13/odoo-bin", line 5, in <module>
import odoo
File "D:\odoo_13_projects\odoo13\odoo\__init__.py", line 113, in <module>
from . import modules
File "D:\odoo_13_projects\odoo13\odoo\modules\__init__.py", line 8, in <module>
from . import db, graph, loading, migration, module, registry
File "D:\odoo_13_projects\odoo13\odoo\modules\graph.py", line 10, in <module>
import odoo.tools as tools
File "D:\odoo_13_projects\odoo13\odoo\tools\__init__.py", line 10, in <module>
from .misc import *
File "D:\odoo_13_projects\odoo13\odoo\tools\misc.py", line 29, in <module>
import werkzeug.utils
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\werkzeug\__init__.py", line 218, in <module>
from .serving import run_simple
File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\werkzeug\serving.py", line 59, in <module>
import SocketServer as socketserver
ModuleNotFoundError: No module named 'SocketServer'
can any one help me please
Can you use python3.6?
because I am already using odoo 13 with python3.6 and I can't see any problem.
I think in your case there will be library mismatch for SocketServer because in python3.7 package name is socketserver.
I found the solution, I use two versions of python so I have to uncheck add content roots to PYTHONPATH and add source roots to PYTHONPATH in pycharm. Thank you guys
Do not use virtual interpreter pythons
that is okey
check this configuration
enter image description here

Python3.7 is not compatible with Tensorflow?

I am trying to continue with a Rasa chatbot that I have not used since September and I find a syntax problem with the dependency of Tensorflow. I do not know if this is due to the fact that there are updates to be made with my dependencies or if it due to the fact that I use python3.7 as suggested by people on GitHub, or some other reason.
(moo_env) C:\Users\antoi\Documents\Programming\projects\moodbot>py train_online.py
Traceback (most recent call last):
File "train_online.py", line 37, in <module>
nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/moodnlu')
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\rasa_core\interpreter.py", line 221, in __init__
self._load_interpreter()
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\rasa_core\interpreter.py", line 237, in _load_interpreter
self.interpreter = Interpreter.load(self.model_directory)
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\rasa_nlu\model.py", line 276, in load
skip_validation)
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\rasa_nlu\model.py", line 298, in create
components.validate_requirements(model_metadata.component_classes)
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\rasa_nlu\components.py", line 49, in validate_requirements
from rasa_nlu import registry
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\rasa_nlu\registry.py", line 23, in <module>
from rasa_nlu.classifiers.embedding_intent_classifier import \
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\rasa_nlu\classifiers\embedding_intent_classifier.py", line 32, in <module>
import tensorflow as tf
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\tensorflow\__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\antoi\Documents\Programming\projects\moodbot\moo_env\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 114
def TFE_ContextOptionsSetAsync(arg1, async):
SyntaxError: invalid syntax
You can find my code in Github repository
The reason is this line in pywrap_tensorflow_internal.py:
def TFE_ContextOptionsSetAsync(arg1, async):
Since Python 3.5, async (and await) are keywords and can no longer be used as identifiers. I assume you use a very outdated version of tensorflow.

ipython3 iptest3 error

I am running Mac OSX 10.7.5. I removed Python 2.7 and installed Python 3.3. I installed ipython and when I run iptest3 I get the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.3/bin/iptest3", line 9, in <module>
load_entry_point('ipython==0.13.1', 'console_scripts', 'iptest3')()
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/distribute-0.6.34-py3.3.egg/pkg_resources.py", line 343, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/distribute-0.6.34-py3.3.egg/pkg_resources.py", line 2308, in load_entry_point
return ep.load()
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/distribute-0.6.34-py3.3.egg/pkg_resources.py", line 2014, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/__init__.py", line 43, in <module>
from .config.loader import Config
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/config/__init__.py", line 16, in <module>
from .application import *
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/config/application.py", line 31, in <module>
from IPython.config.configurable import SingletonConfigurable
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/config/configurable.py", line 26, in <module>
from .loader import Config
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/config/loader.py", line 27, in <module>
from IPython.utils.path import filefind, get_ipython_dir
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/utils/path.py", line 25, in <module>
from IPython.utils.process import system
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/utils/process.py", line 27, in <module>
from ._process_posix import _find_cmd, system, getoutput, arg_split
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/utils/_process_posix.py", line 22, in <module>
from IPython.external import pexpect
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/external/pexpect/__init__.py", line 2, in <module>
import pexpect
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pexpect-2.4-py3.3.egg/pexpect.py", line 82
except ImportError, e:
^
SyntaxError: invalid syntax
pexpect is not compatible with Python 3. You need to install pexpect-u.
Seem like a pexpect issue to me.
Can you import pexpect in normal python3.3 shell ?
Also
I'm not sure the ipython .egg works on python3.
I don't think you need to remove 2.7 to use 3.3

Resources