Pycharm error: module must not be null?

Hi all

 

I am getting this error on my pycharm community addition:

Build #PC-222.4345.23, built on October 10, 2022

Runtime version: 17.0.4.1+7-b469.62 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

It is a simple python web scraping script but it won't run.

Below is the error and my run config:

 

 

 

This is my code, it runs on my ubuntu laptop with pycharm: https://github.com/jzoudavy/webScrap_Selenium/blob/main/test.py

 

I am not sure what's missing here. 

 

Thanks



Error running 'test': Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null

8 comments
Comment actions Permalink

hi can someone approve this post pls?

0
Comment actions Permalink

issue resolved by restarting pycharm

0
Comment actions Permalink

I am getting the same error trying to run a python script in IntelliJ. Restarting IntelliJ did not resolve the issue.

1
Comment actions Permalink

I was able to fix this by switching to a different python interpreter in my run configuration which could run the desired script, running the script, and then switching back to the original python interpreter. I have no idea why that worked

0
Comment actions Permalink
2022-12-30 23:41:26,994 [  18033]   INFO - #c.i.e.r.ExecutionUtil - Error running 'app no update':<br>Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null
at com.intellij.openapi.roots.ModuleRootManager.$$$reportNull$$$0(ModuleRootManager.java)
at com.intellij.openapi.roots.ModuleRootManager.getInstance(ModuleRootManager.java)
at com.jetbrains.python.run.PythonScripts.ensureProjectSdkAndModuleDirsAreOnTarget(PythonScripts.kt:223)
at com.jetbrains.python.run.PythonCommandLineState.buildPythonExecutionFinal(PythonCommandLineState.java:363)
at com.jetbrains.python.run.PythonCommandLineState.startProcess(PythonCommandLineState.java:324)
at com.jetbrains.python.run.PythonCommandLineState.execute(PythonCommandLineState.java:232)
at com.jetbrains.python.run.PythonScriptCommandLineState.execute(PythonScriptCommandLineState.java:148)
at com.jetbrains.python.run.PythonCommandLineState.execute(PythonCommandLineState.java:178)
at com.jetbrains.python.run.PythonRunner.lambda$execute$2(PythonRunner.java:67)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)
 
0
Comment actions Permalink

Hi,

Can someone please provide steps to reproduce the issue or a code sample? The link from the first post is not working anymore. 

0
Comment actions Permalink

I had the same problem, i resolved it : Go on Run -> edit configuration -> on the right side find where is "paramaters" and fill it by one of the options given by Pycharm This is how it looks like

1
Comment actions Permalink

You need to select the execution method ( you can select 1st option). else the tool doesn't know where to get this executed.

0

Please sign in to leave a comment.