IndEcol / pymrio

Multi-Regional Input-Output Analysis in Python.
http://pymrio.readthedocs.io/en/latest/
Other
158 stars 71 forks source link

Exio3 parser permission error #35

Closed MaximeAgez closed 5 years ago

MaximeAgez commented 5 years ago

Hi, I am trying to use the parser of exiobase3 and I get a permission error. It seems that the parser only accepts zip files? Yet, when I use the zip file directly downloaded from exiobase website it tells me KeyError: "There is no item named 'mrIot3.0.txt' in the archive", and when i use the unzipped file i get the following error:

io = pymrio.parse_exiobase3('C://Users/Maxime/Desktop/Thesis/Bdd/IOT_2011_pxp/')

PermissionError Traceback (most recent call last)

in () ----> 1 io = pymrio.parse_exiobase3('C://Users/Maxime/Desktop/Thesis/Bdd/IOT_2011_pxp/') C://Users/Maxime/Desktop/Thesis/Modules_Python/pymrio-master\pymrio\tools\ioparser.py in parse_exiobase3(zip_file, path_in_zip, version, iosystem, year, charact) 498 # read the data into a dicts as pandas.DataFrame 499 logging.info('Read exiobase3 from {}'.format(zip_file)) --> 500 zip_file = zipfile.ZipFile(zip_file) 501 502 core_data = {exio_table: pd.read_table( C:\Users\Maxime\Anaconda3\lib\zipfile.py in __init__(self, file, mode, compression, allowZip64) 1088 while True: 1089 try: -> 1090 self.fp = io.open(file, filemode) 1091 except OSError: 1092 if filemode in modeDict: PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Maxime\\Desktop\\Thesis\\Bdd\\IOT_2011_pxp'
konstantinstadler commented 5 years ago

Hi, I can not reproduce the bug. Are you using the latest publicly available exiobase version: you should have a exio34.ini file in the extracted directory.

MaximeAgez commented 5 years ago

Yes I have the exio34.ini file in the extracted directory

On Wed, 28 Nov 2018 at 08:44, Konstantin Stadler notifications@github.com wrote:

Hi, I can not reproduce the bug. Are you using the latest publicly available exiobase version: you should have a exio34.ini file in the extracted directory.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/konstantinstadler/pymrio/issues/35#issuecomment-442451232, or mute the thread https://github.com/notifications/unsubscribe-auth/AXKRxFLALIdku7I3tlyJitJhBBSWMBJhks5uzpM4gaJpZM4YgG-3 .

konstantinstadler commented 5 years ago

Hi,

can you do

import pymrio
import sys
print("Python :{}, pandas: {}, pymrio: {}".format(sys.version_info, pymrio.pd.__version__, pymrio.__version__))

and send me the output.

MaximeAgez commented 5 years ago

Hi, sorry for the late reply.

print("Python :{}, pandas: {}, pymrio: {}".format(sys.version_info, pd.version, pymrio.version))

Python :sys.version_info(major=3, minor=6, micro=6, releaselevel='final', serial=0), pandas: 0.23.4, pymrio: 0.2.2

On Thu, 29 Nov 2018 at 11:33, Konstantin Stadler notifications@github.com wrote:

Hi,

can you do ` import pymrio import sys print("Python :{}, pandas: {}, pymrio: {}".format(sys.version_info, pymrio.pd.version, pymrio.version))

` and send me the output.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/konstantinstadler/pymrio/issues/35#issuecomment-442900997, or mute the thread https://github.com/notifications/unsubscribe-auth/AXKRxEUYz1jb-bv0NWgePLduBb6H1xALks5u0AxBgaJpZM4YgG-3 .

konstantinstadler commented 5 years ago

There is your problem: you are far behind the current release. Current pymrio version: 0.3.8 - you use 0.2.2. Run

pip install pymrio --upgrade

This should solve your problem. Anyway, please let me know if it worked.

MaximeAgez commented 5 years ago

Yes it works. Thought I had already installed the latest version of pymrio. Sorry for the dumb mistake and thank you.

Best regards

On Wed, 5 Dec 2018 at 16:51, Konstantin Stadler notifications@github.com wrote:

There is your problem: you are far behind the current release. Current pymrio version: 0.3.8 - you use 0.2.2. Run

pip install pymrio --upgrade

This should solve your problem. Anyway, please let me know if it worked.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/konstantinstadler/pymrio/issues/35#issuecomment-444663772, or mute the thread https://github.com/notifications/unsubscribe-auth/AXKRxBSvD0IElT6mowJsX7o5Vkfyy9UUks5u2D_FgaJpZM4YgG-3 .

konstantinstadler commented 5 years ago

No problem. Happy to help!