Skip to content
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

BUG: Errors when running pandas on development environment #58229

Closed
3 tasks done
shriyakalakata opened this issue Apr 12, 2024 · 5 comments
Closed
3 tasks done

BUG: Errors when running pandas on development environment #58229

shriyakalakata opened this issue Apr 12, 2024 · 5 comments
Labels
Build Library building on various platforms Needs Info Clarification about behavior needed to assess issue

Comments

@shriyakalakata
Copy link
Contributor

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

(pandas-dev) (base) shriyakalakata@Shriyas-MacBook-Pro pandas-shriyakalakata % python
Python 3.11.4 (main, Jul  5 2023, 08:54:11) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
+ /Users/shriyakalakata/virtualenvs/pandas-dev/bin/ninja
[4/11] Compiling Cython source /Users/shriyakalakata/Desktop/Projects/pandas-shriyakalakata/pandas/_libs/hashtable.pyx
FAILED: pandas/_libs/hashtable.cpython-311-darwin.so.p/pandas/_libs/hashtable.pyx.c 
cython -M --fast-fail -3 --include-dir /Users/shriyakalakata/Desktop/Projects/pandas-shriyakalakata/build/cp311/pandas/_libs '-X always_allow_keywords=true' /Users/shriyakalakata/Desktop/Projects/pandas-shriyakalakata/pandas/_libs/hashtable.pyx -o pandas/_libs/hashtable.cpython-311-darwin.so.p/pandas/_libs/hashtable.pyx.c

Error compiling Cython file:
------------------------------------------------------------
...
        self.data.n = 0
        self.data.m = _INIT_VEC_CAP
        self.ao = np.empty(self.data.m, dtype=np.int64)
        self.data.data = <int64_t*>self.ao.data

    cdef resize(self):
         ^
------------------------------------------------------------

/Users/shriyakalakata/Desktop/Projects/pandas-shriyakalakata/pandas/_libs/hashtable_class_helper.pxi:616:9: Signature not compatible with previous declaration
[5/11] Compiling Cython source /Users/shriyakalakata/Desktop/Projects/pandas-shriyakalakata/pandas/_libs/interval.pyx
FAILED: pandas/_libs/interval.cpython-311-darwin.so.p/pandas/_libs/interval.pyx.c 
cython -M --fast-fail -3 --include-dir /Users/shriyakalakata/Desktop/Projects/pandas-shriyakalakata/build/cp311/pandas/_libs '-X always_allow_keywords=true' /Users/shriyakalakata/Desktop/Projects/pandas-shriyakalakata/pandas/_libs/interval.pyx -o pandas/_libs/interval.cpython-311-darwin.so.p/pandas/_libs/interval.pyx.c

Error compiling Cython file:
------------------------------------------------------------
...
                self.root.query(result, target[i])
            except OverflowError:
                # overflow -> no match, which is already handled below
                pass

            if result.data.n == old_len:
                          ^
------------------------------------------------------------

/Users/shriyakalakata/Desktop/Projects/pandas-shriyakalakata/pandas/_libs/intervaltree.pxi:148:26: Object of type 'Int64VectorData' has no attribute 'n'
[6/11] Compiling C object pandas/_libs/lib.cpython-311-darwin.so.p/meson-generated_pandas__libs_lib.pyx.c.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1138, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1078, in _find_spec
  File "/Users/shriyakalakata/virtualenvs/pandas-dev/lib/python3.11/site-packages/_pandas_editable_loader.py", line 268, in find_spec
    tree = self.rebuild()
           ^^^^^^^^^^^^^^
  File "/Users/shriyakalakata/virtualenvs/pandas-dev/lib/python3.11/site-packages/_pandas_editable_loader.py", line 309, in rebuild
    subprocess.run(self._build_cmd, cwd=self._build_path, env=env, stdout=stdout, check=True)
  File "/Users/shriyakalakata/anaconda3/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/Users/shriyakalakata/virtualenvs/pandas-dev/bin/ninja']' returned non-zero exit status 1.

Issue Description

In the development environment, after I type python and then do import pandas, I get a lot of errors. I didn't get this before and I made sure to run the git reset --hard upstream/main first.

Expected Behavior

No errors

Installed Versions

Replace this line with the output of pd.show_versions()

@shriyakalakata shriyakalakata added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 12, 2024
@lithomas1
Copy link
Member

You can try deleting your build folder to see if that helps.

Your Cython version also might be too old, try installing the latest version.

@lithomas1 lithomas1 added Build Library building on various platforms Needs Info Clarification about behavior needed to assess issue and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 12, 2024
@shriyakalakata
Copy link
Contributor Author

@lithomas1 Thank you for responding promptly! I tried both (my previous version of Cython was 3.0.9 and now is 3.0.10). I'm still facing the same issue.

@priyapandey26
Copy link

Hi @shriyakalakata can you share the steps what you tried?

@lithomas1
Copy link
Member

Can you try deleting your build folder? Should be build, which lives under your main pandas directory.

@shriyakalakata
Copy link
Contributor Author

shriyakalakata commented Apr 17, 2024

@priyapandey26 It was fixed by doing the following steps:

  • delete the build folder
  • git clean by running git clean -xfd .
  • rebuild by running the python -m pip install -ve . --no-build-isolation --config-settings editable-verbose=true command

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

3 participants