Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm error: Cannot determine module type ("WEB_MODULE")

I'm using Pycharm Professional 4.5.4 to develop a javascript project and was seeing some odd behaviour when opening the project in the browser.

The project structure is something like

/MyProject
    /data
    /images
    /python
    /etc
    /webapp
    /webapp_copy

I was trying out a few changes in the webapp_copy folder, but when I launched in the browser, pycharm launched the webapp version of the site. No idea why it was doing this, maybe because the structure and contents were similar.

Anyway, I closed the project and reopened just the webapp_copy folder. Now I'm getting the error Cannot determine module type ("WEB_MODULE") for the following module:"webapp_copy".

When I browse the .idea folder and look at webapp_copy.iml, is does indeed say

<module type="WEB_MODULE" version="4">

Why would Pycharm label this module as a web module, then later claim it doesn't know what a web module is?

I've tried searching, but I either get results for IntelliJ or something about python modules. https://www.jetbrains.com/idea/help/supported-module-types.html

UPDATE: I've raised this as an issue with JetBrains - feel free to vote on it! https://youtrack.jetbrains.com/issue/PY-17084

like image 753
jon_two Avatar asked Oct 01 '15 09:10

jon_two


2 Answers

When I had a similar problem (type="RUBY_MODULE") it was because I had opened the directory containing the code originally using RubyMine so it created the .idea directory/content based on what it supports.

I don't know if you (or someone else) originally used something else that created the .idea directory so YMMV, but per the link you listed, the WEB_MODULE type only seems to apply to IntelliJ Ultimate.

To fix this, simply change the type to PYTHON_MODULE in the .iml file, restart PyCharm and the warning should go away. If you are, in fact, using IntelliJ, you should be fine as PYTHON_MODULE is supported by the Ultimate edition per your link (although you may have to install a specific python add-in).

like image 109
Todd L Avatar answered Oct 19 '22 19:10

Todd L


It's worked for me just by remove directory .idea and reopen Pycharm.

like image 35
CK.Nguyen Avatar answered Oct 19 '22 17:10

CK.Nguyen