BUILD: Getting Syntax error for pandas library import in python If not using virtual env

This issue has been created since 2022-09-20.

Installation check

Platform

Windows-10-10.0.19044-SP0

Installation Method

pip install

pandas Version

latest

Python Version

3.10.6

Installation Logs

If I use virtual env then everything is fine But if I run simply then getting syntax error for any kind of library import

Consider a simple pandas library import program

import pandas as pd




C:\Users\Keshav\Desktop\GAN_Assignment>python main.py
Traceback (most recent call last):
  File "C:\Users\Keshav\Desktop\GAN_Assignment\main.py", line 1, in <module>
    import pandas as pd
  File "C:\Users\Keshav\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\__init__.py", line 22, in <module>
    from pandas.compat import is_numpy_dev as _is_numpy_dev
  File "C:\Users\Keshav\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\compat\__init__.py", line 15, in <module>      
    from pandas.compat.numpy import (
  File "C:\Users\Keshav\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\compat\numpy\__init__.py", line 4, in <module> 
    from pandas.util.version import Version
  File "C:\Users\Keshav\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\util\__init__.py", line 1, in <module>
    from pandas.util._decorators import (  # noqa:F401
  File "C:\Users\Keshav\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\util\_decorators.py", line 14, in <module>     
    from pandas._libs.properties import cache_readonly  # noqa:F401
  File "C:\Users\Keshav\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\_libs\__init__.py", line 13, in <module>       
    from pandas._libs.interval import Interval
  File "pandas\_libs\interval.pyx", line 1, in init pandas._libs.interval
  File "pandas\_libs\hashtable.pyx", line 1, in init pandas._libs.hashtable
  File "pandas\_libs\missing.pyx", line 1, in init pandas._libs.missing
  File "C:\Users\Keshav\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\_libs\tslibs\__init__.py", line 30, in <module>
    from pandas._libs.tslibs.conversion import (
  File "pandas\_libs\tslibs\conversion.pyx", line 1, in init pandas._libs.tslibs.conversion
  File "pandas\_libs\tslibs\timezones.pyx", line 14, in init pandas._libs.tslibs.timezones
  File "C:\Users\Keshav\AppData\Local\Programs\Python\Python310\lib\site-packages\dateutil\tz.py", line 78
    `self._name`,
    ^
SyntaxError: invalid syntax

16b8583075ed5ab039e26ab7c6f49777160b4f53

lithomas1 wrote this answer on 2022-09-20

This looks like a problem with dateutil not pandas. Can you try pip uninstalling python-dateutil and reinstalling it?
Thanks.

More Details About Repo
Owner Name pandas-dev
Repo Name pandas
Full Name pandas-dev/pandas
Language Python
Created Date 2010-08-24
Updated Date 2022-09-29
Star Count 35374
Watcher Count 1122
Fork Count 15034
Issue Count 3579

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
network labels are too big in Chrome 10 2016-08-12 2022-09-06
v6.1.15 @ Ubuntu 20.04 = High CPU 8 2022-03-16 2022-08-31
Open ZK notes on any neovim location 1 2022-02-04 2022-09-24
Third degree equation solver 1 2022-03-17 2022-09-11
3.17.3 Wheel Filenames for Python 3.x Manylinux 5 2021-08-18 2022-07-22
1.17.0v Moonraker warnings. 9 2022-02-26 2022-08-05
Help needed in Mario kart Double Dash! 1 2022-06-26 2022-09-19
Unable to resolve read address 14000000 PC 800665c8 error 1 2022-06-19 2022-09-19
Can't Create Memory Card File (Wii U VC Injector) 3 2022-06-26 2022-09-19
Add an option to hide the left menu 5 2021-10-26 2022-07-14
Fatal error: Steam needs to be online to update (Fedora rawhide) 3 2021-02-27 2022-09-15
OpenFPGA flow fails when an extra reg is added to the and2_latch 3 2021-07-02 2022-08-14
Assets in the Vite `.output/public/_nuxt/manifest.json` file with `"isEntry": true"` flag is not preloaded with `<link rel="preload">` 0 2022-04-23 2022-09-26
Add policies 0 2021-07-26 2022-01-09
New Ionicons support 3 2020-02-12 2022-09-27
Include indicator for Downtime/ACK in TileRenderer 3 2019-06-24 2022-09-27
Formatting for numbers 0 2022-08-05 2022-08-30
AppiumDriverLocalService.addLogMessageConsumer(Consumer<String>) supply garbled characters in chinese words , 中文字符乱码 2 2021-12-24 2022-08-29
Add region and country to geo lookups 5 2021-02-02 2022-08-20
Question about log-likelihood for model with discrete variables 3 2022-07-19 2022-09-03
Examples using Stein BNN for Binary and Multi-Class Classification 5 2022-07-14 2022-09-03
BUG: minimize(method=’L-BFGS-B’) documentation is contradictory 1 2022-09-21 2022-09-21
Create a new sandbox when starting a program and close it after the program terminates. 2 2022-06-10 2022-08-22
Trailing whitespace in file 3 2021-06-17 2022-09-28
Aurora - Deletion protection is at cluster level and not DB instance level - foundational security logic should be updated 1 2022-05-26 2022-07-27
Don't show crux for multistep tests 0 2022-02-03 2022-09-27
[feature] add clang support on windows 28 2021-07-20 2022-07-06
$id is not defined 2 2020-10-31 2022-01-20
Support for JetBrains Rider IDE Build 203.* 1 2020-12-18 2022-09-07
NewTab Adapter doesn't respect Vivaldi 4 2021-12-29 2022-05-19
[BUG] - EditChannels 0 2022-02-08 2022-09-25
该升级一下了,swoole 1.9版本的,composer安装不了 1 2017-07-05 2022-08-01
How to output all classes 2 2022-05-05 2022-09-15
This problem occurred when I upgraded to react 18 4 2022-04-12 2022-09-20
Webhooks on events 1 2021-07-26 2022-01-05
Reopen a closed window 0 2022-01-17 2022-09-25
getting AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE error after certificate update 6 2021-10-12 2022-09-20
Feature Request: configurable worker threads concurrency of Envoy 0 2020-11-25 2022-09-09
Cycles & EEVEE:not using GPU rendering 15 2020-04-20 2022-09-08
Select the vcruntime for each major release 1 2014-05-13 2022-08-30
Needs more max_user_watches 2 2020-12-22 2022-09-26
yarn 2 - @cypress/webpack-dev-server tried to access lodash, but it isn't declared in its dependencies 2 2021-09-13 2022-02-10
Consider dropping dependency on rules_cc 4 2021-10-16 2022-09-29
vscode tensorboard on remote server not able to Download Current Chart as SVG 4 2021-09-24 2022-09-27
Unable to test on PR request_reviewers logins 0 2021-12-22 2022-09-27
Mongoose Slack Channel is not Accessible 1 2022-08-17 2022-09-07
the encoded excitation 0 2020-10-16 2022-09-28
No such widget `.hsmw-saved-backward-delete-char' 0 2021-09-20 2021-10-21
pub topic is PacketId=undefined 0 2021-05-28 2022-09-17
Changes since v4.5.0 of eslint-plugin-react-hooks are not listed in CHANGELOG 0 2022-06-23 2022-09-26