Zipimport in PyCharm

Does PyCharm code inspector allow zipimport? I'm trying to make App Engine application with zipped framework with code like this:

import sys

sys.path.insert(0, 'framework.zip')

import framework

It works well, but code inspector doesn't see framework and shows a lot of unexisting errors in code. Am I doing something wrong or PyCharm doesn't support zipimport?

4 comments
Comment actions Permalink

Hello Alexey,

PyCharm does support imports from zip files, but it doesn't have any automatic

way to figure out where the zip file is by looking at your code. You'll need

to add the zip file manually to the interpreter paths in Settings | Python

Interpreter.

Does PyCharm code inspector allow zipimport? I'm trying to make App

Engine application with zipped framework with code like this:

import sys

sys.path.insert(0, 'framework.zip')

import framework

It works well, but code inspector doesn't see framework and shows a

lot of unexisting errors in code. Am I doing something wrong or

PyCharm doesn't support zipimport?

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

I've added zip file to interpreter paths, but references still shows as unresolved. After closing and re-opening project current zip file disappears from paths.

0
Comment actions Permalink

Hello Alexey,

Please try PyCharm 1.1 released today; it has a number of fixes related to

this issue.

I've added zip file to interpreter paths, but references still shows

as unresolved. After closing and re-opening project current zip file

disappears from paths.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

Thanks, 1.1 works great.

0

Please sign in to leave a comment.