Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
gmmkmtgk opened this issue Sep 20, 2022 · 2 comments
Closed
1 task done
Labels
Build Library building on various platforms Needs Info Clarification about behavior needed to assess issue

Comments

@gmmkmtgk
Copy link

gmmkmtgk commented Sep 20, 2022

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

@gmmkmtgk gmmkmtgk added Build Library building on various platforms Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 20, 2022
@lithomas1
Copy link
Member

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

@mroeschke mroeschke added Needs Info Clarification about behavior needed to assess issue and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 20, 2022
@phofl
Copy link
Member

phofl commented Sep 29, 2022

Closing for now. Please ping to reopen, when you can answer questions

@phofl phofl closed this as completed Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Needs Info Clarification about behavior needed to assess issue
Projects
None yet
Development

No branches or pull requests

4 participants