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

Error when importing CPI in ipython3 Jupyter notebook via Anaconda: "no such table: cu area" #79

Closed
sarkabodisian opened this issue Jul 20, 2023 · 11 comments

Comments

@sarkabodisian
Copy link

Hi palewire,

I am trying to use the cpi library in an ipython3 Jupyter notebook running via Anaconda Navigator on a Windows 10 OS. I can successfully run pip install cpi, but when I import cpi I get the same "no such table: cu area" error message that is mentioned here: #62

For context, I can install and import other libraries through the Jupyter notebook. Also, I was able to both install and import the cpi library in January 2023. Is it possible that the solution you implemented for issues #62 is not translating into my coding environment?
image

Thank you!

@palewire
Copy link
Owner

palewire commented Jul 20, 2023 via email

@rhpierson4
Copy link

I also experienced this issue until I uninstalled mapclassify. Not sure if you also have that package installed.

@nuritmb
Copy link

nuritmb commented Sep 14, 2023

I experience this same problem running my program from the terminal on a Mac. This is the full message I get after trying to import:

/Users/rufus/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 warnings.warn( Traceback (most recent call last): File "/Users/rufus/Desktop/templates/scripts/bookListpruner.py", line 3, in <module> import cpi File "/Users/rufus/Library/Python/3.9/lib/python/site-packages/cpi/__init__.py", line 21, in <module> areas = parsers.ParseArea().parse() File "/Users/rufus/Library/Python/3.9/lib/python/site-packages/cpi/parsers.py", line 52, in parse for row in self.get_file("cu.area"): File "/Users/rufus/Library/Python/3.9/lib/python/site-packages/cpi/parsers.py", line 29, in get_file query = cursor.execute(f'SELECT * FROM "{file}"') sqlite3.OperationalError: no such table: cu.area

@Cheeseborg
Copy link

faced the same issue after i ran cpi.update(), "fixed" it by reinstalling cpi

@palewire
Copy link
Owner

Can someone help me here by providing more detail about their OS and the code that can reproduce the bug?

I am shooting in the dark here, but I wonder if it might be something to do with the finicky install of sqlite.

@Cheeseborg
Copy link

So it works normally before cpi.update(but gives warnings),
Снимок экрана 2023-11-09 154910
and after running an update it starts giving the "no such table: cu area"
i'm using anaconda on windows 11

@tkreindler
Copy link

I can consistently reproduce it with a fresh virtual environment for both Python 3.11.7 and Python 3.12.0.

Here's my requirements.txt:

asttokens==2.4.1
colorama==0.4.6
comm==0.2.0
cpi==1.0.22
debugpy==1.8.0
decorator==5.1.1
executing==2.0.1
ipykernel==6.28.0
ipython==8.19.0
jedi==0.19.1
jupyter_client==8.6.0
jupyter_core==5.5.1
matplotlib-inline==0.1.6
nest-asyncio==1.5.8
numpy==1.26.2
packaging==23.2
pandas==2.1.4
parso==0.8.3
platformdirs==4.1.0
plotly==5.18.0
prompt-toolkit==3.0.43
psutil==5.9.7
pure-eval==0.2.2
Pygments==2.17.2
python-dateutil==2.8.2
pywin32==306
pyzmq==25.1.2
six==1.16.0
stack-data==0.6.3
tornado==6.4
traitlets==5.14.0
wcwidth==0.2.12
yfinance==0.2.33

@fischcheng
Copy link

reinstalling cpi fixed this for me, but I'm now getting issues when running cpi.update()

image

@palewire palewire mentioned this issue Jan 4, 2024
@palewire
Copy link
Owner

palewire commented Jan 4, 2024

In pull request #97 I merged in a new set of tests that verify this library works within conda. The routine creates a new env, installs our dependencies and runs our tests. You can find the key bits of conda code here.

Does this help address the issue you've raised?

@sarkabodisian
Copy link
Author

Hi @palewire, yes it did. Thank you! I just tried this out by reinstalling the cpi library and I was able to import cpi as well as execute cpi.update and cpi.inflate without issue, using the same environment I was using when I raised this: ipython3 Jupyter notebook running via Anaconda Navigator on a Windows 10 OS.

@palewire
Copy link
Owner

palewire commented Jan 4, 2024

Excellent news!

@palewire palewire closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants