I have pyscripter version 3.2.2.0 x86 running python 3.6.3
When I want to import pandas in a py module(i.e. import pandas as pd),
I end up with an exception : invalid syntax
Traceback (most recent call last):
File "<string>", line 424, in run_nodebug
File "<module1>", line 13, in <module>
File "D:\Users\Jean\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\__init__.py", line 13, in <module>
__import__(dependency)
File "D:\Users\Jean\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytz\__init__.py", line 19, in <module>
from pytz.lazy import LazyDict, LazyList, LazySet
File "D:\Users\Jean\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytz\lazy.py", line 3, in <module>
from UserDict import DictMixin
File "D:/Users/Jean\Desktop/Kodi Python Development/PythonPourDebutants/App/Lib\UserDict.py", line 134
raise TypeError, "pop expected at most 2 arguments, got "\
^
SyntaxError: invalid syntax
but when I import in command line, everything is ok !
why is it so ?
thanks for your answers !
Related
I've been trying to get odoo 15 to work for a bit while and after installing all dependencies and trying to run the app I've come into this error.
Traceback (most recent call last):
File "C:\odoo-15-test\server\odoo-bin", line 4, in <module>
import odoo
File "C:\odoo-15-test\server\odoo\__init__.py", line 11, in <module>
from . import http
File "C:\odoo-15-test\server\odoo\http.py", line 50, in <module>
from .service.server import memory_info
File "C:\odoo-15-test\server\odoo\service\__init__.py", line 4, in <module>
from . import common
File "C:\odoo-15-test\server\odoo\service\common.py", line 6, in <module>
import odoo.tools
File "C:\odoo-15-test\server\odoo\tools\__init__.py", line 21, in <module>
from .convert import *
File "C:\odoo-15-test\server\odoo\tools\convert.py", line 33, in <module>
from odoo import SUPERUSER_ID, api
File "C:\odoo-15-test\server\odoo\api.py", line 1022, in <module>
from odoo import SUPERUSER_ID
ImportError: cannot import name 'SUPERUSER_ID' from partially initialized module 'odoo' (most likely due to a circular import) (C:\odoo-15-test\server\odoo\__init__.py)
I have tried installing odoo with 'pip install odoo' but this didnt work and I don't see this being the problem. I have also never run into circular imports before so any help would be great thanks.
I have a python code for a discord bot. It is working locally but when I try to run it on replit.com I get this error.
Traceback (most recent call last):
File "main.py", line 2, in <module>
import pandas as pd
File "/home/runner/Animanji/venv/lib/python3.8/site-packages/pandas/__init__.py", line 48, in <module>
from pandas.core.api import (
File "/home/runner/Animanji/venv/lib/python3.8/site-packages/pandas/core/api.py", line 48, in <module>
from pandas.core.groupby import (
File "/home/runner/Animanji/venv/lib/python3.8/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import (
File "/home/runner/Animanji/venv/lib/python3.8/site-packages/pandas/core/groupby/generic.py", line 70, in <module>
from pandas.core.frame import DataFrame
File "/home/runner/Animanji/venv/lib/python3.8/site-packages/pandas/core/frame.py", line 157, in <module>
from pandas.core.generic import NDFrame
File "/home/runner/Animanji/venv/lib/python3.8/site-packages/pandas/core/generic.py", line 152, in <module>
from pandas.core.window import (
File "/home/runner/Animanji/venv/lib/python3.8/site-packages/pandas/core/window/__init__.py", line 1, in <module>
from pandas.core.window.ewm import ( # noqa:F401
File "/home/runner/Animanji/venv/lib/python3.8/site-packages/pandas/core/window/ewm.py", line 12, in <module>
import pandas._libs.window.aggregations as window_aggregations
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory
I already installed the packages but didn't work, but it pandas does work on the bash window when I run python3 there.
I couldn't find any solution other than forking another repl and putting my files there.
here is the repl if anyone is interested: https://replit.com/#HourKesh/AppropriateKnobbyInstruction#poetry.lock .
Try going to the replit shell and type pip3 install pandas.
I installed tensorflow gpu one day ago at that time it was working fine, but now when I am trying to launch the notebook i am getting following error.
Traceback (most recent call last):
File "C:\Users\sumanta\anaconda3\envs\tf_2.5\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\sumanta\anaconda3\envs\tf_2.5\lib\site-packages\notebook\notebookapp.py", line 80, in <module>
from .services.contents.manager import ContentsManager
File "C:\Users\sumanta\anaconda3\envs\tf_2.5\lib\site-packages\notebook\services\contents\manager.py", line 17, in <module>
from nbformat import sign, validate as validate_nb, ValidationError
File "C:\Users\sumanta\anaconda3\envs\tf_2.5\lib\site-packages\nbformat\__init__.py", line 32, in <module>
from .validator import validate, ValidationError
File "C:\Users\sumanta\anaconda3\envs\tf_2.5\lib\site-packages\nbformat\validator.py", line 12, in <module>
from .json_compat import get_current_validator, ValidationError
File "C:\Users\sumanta\anaconda3\envs\tf_2.5\lib\site-packages\nbformat\json_compat.py", line 10, in <module>
import jsonschema
File "C:\Users\sumanta\anaconda3\envs\tf_2.5\lib\site-packages\jsonschema\__init__.py", line 14, in <module>
from jsonschema._format import (
File "C:\Users\sumanta\anaconda3\envs\tf_2.5\lib\site-packages\jsonschema\_format.py", line 240, in <module>
#_checks_drafts(draft7="idn-hostname", raises=idna.IDNAError)
AttributeError: module 'idna' has no attribute 'IDNAError'
A very, very basic solution - but what fixed this a while back for me was pip install idna. Give it a shot.
I am getting this error,
/tmp/Python-3.7.5$ python3 main.py
Traceback (most recent call last):
File "main.py", line 3, in <module>
import pandas as pd
File "/home/abc/.local/lib/python3.7/site-packages/pandas/__init__.py", line 51, in <module>
from pandas.core.api import (
File "/home/abc/.local/lib/python3.7/site-packages/pandas/core/api.py", line 31, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "/home/abc/.local/lib/python3.7/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import DataFrameGroupBy, NamedAgg, SeriesGroupBy
File "/home/abc/.local/lib/python3.7/site-packages/pandas/core/groupby/generic.py", line 65, in <module>
from pandas.core.frame import DataFrame
File "/home/abc/.local/lib/python3.7/site-packages/pandas/core/frame.py", line 119, in <module>
from pandas.core import algorithms, common as com, generic, nanops, ops
File "/home/abc/.local/lib/python3.7/site-packages/pandas/core/generic.py", line 112, in <module>
from pandas.io.formats import format as fmt
File "/home/abc/.local/lib/python3.7/site-packages/pandas/io/formats/format.py", line 77, in <module>
from pandas.io.common import stringify_path
File "/home/abc/.local/lib/python3.7/site-packages/pandas/io/common.py", line 3, in <module>
import bz2
File "/usr/local/lib/python3.7/bz2.py", line 19, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'
what is the solution?
How did you install your Python? If you've manually built it or used the make command, you might be missing the bz2 library headers.
Try the following...
Centos/Fedora/RHEL:
sudo yum install bzip2-devel
Debian and Ubuntu:
sudo apt-get install libbz2-dev
You'll then either need to rebuild your Python installation or to copy the header in your Python folder, with:
sudo cp /usr/lib/python3.7/lib-dynload/_bz2.cpython-38-x86_64-linux-gnu.so /usr/local/lib/python3.7/
Good day,
I get the following error when importing xlrd. Does any one get this?
import xlrd
Error:
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
import xlrd
File "C:\Users\irwin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\xlrd\__init__.py", line 1187
print "EXTERNSHEET(b7-):"
^
SyntaxError: invalid syntax