OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Python in Jupyter Notebook - Import CPI get an error message

  • Thread starter Thread starter Marino35
  • Start date Start date
M

Marino35

Guest
When i try to import cpi in jupyter notebook, i get this error message. Does anyone have an idea how to address this issue?



Code:
OperationalError                          Traceback (most recent call last)
/var/folders/59/k880nk6s3m3_fp0p5dc6hfhc0000gn/T/ipykernel_6186/1241436912.py in 
<module>
----> 1 import cpi

     ~/opt/anaconda3/lib/python3.8/site-packages/cpi/__init__.py in <module>
     19 # Parse data for use
     20 logger.info("Parsing data files from the BLS")
---> 21 areas = parsers.ParseArea().parse()
     22 items = parsers.ParseItem().parse()
     23 periods = parsers.ParsePeriod().parse()

~/opt/anaconda3/lib/python3.8/site-packages/cpi/parsers.py in parse(self)
     58         logger.debug("Parsing area file")
     59         object_list = MappingList()
---> 60         for row in self.get_file("cu.area"):
     61             obj = Area(row["area_code"], row["area_name"])
     62             object_list.append(obj)

~/opt/anaconda3/lib/python3.8/site-packages/cpi/parsers.py in get_file(self, file)
     35 
     36         # Query this file
---> 37         query = cursor.execute(f'SELECT * FROM "{file}"')
     38         columns = [d[0] for d in query.description]
     39         result_list = [dict(zip(columns, r)) for r in query.fetchall()]

OperationalError: no such table: cu.area
<p>When i try to import cpi in jupyter notebook, i get this error message. Does anyone have an idea how to address this issue?</p>
<hr />
<pre><code>OperationalError Traceback (most recent call last)
/var/folders/59/k880nk6s3m3_fp0p5dc6hfhc0000gn/T/ipykernel_6186/1241436912.py in
<module>
----> 1 import cpi

~/opt/anaconda3/lib/python3.8/site-packages/cpi/__init__.py in <module>
19 # Parse data for use
20 logger.info("Parsing data files from the BLS")
---> 21 areas = parsers.ParseArea().parse()
22 items = parsers.ParseItem().parse()
23 periods = parsers.ParsePeriod().parse()

~/opt/anaconda3/lib/python3.8/site-packages/cpi/parsers.py in parse(self)
58 logger.debug("Parsing area file")
59 object_list = MappingList()
---> 60 for row in self.get_file("cu.area"):
61 obj = Area(row["area_code"], row["area_name"])
62 object_list.append(obj)

~/opt/anaconda3/lib/python3.8/site-packages/cpi/parsers.py in get_file(self, file)
35
36 # Query this file
---> 37 query = cursor.execute(f'SELECT * FROM "{file}"')
38 columns = [d[0] for d in query.description]
39 result_list = [dict(zip(columns, r)) for r in query.fetchall()]

OperationalError: no such table: cu.area
</code></pre>
 

Online statistics

Members online
0
Guests online
5
Total visitors
5
Top