Running a Github File on VS code for windows 10- File system problem (

In summary, running a Github file on VS code for Windows 10 can encounter file system problems. These problems can be caused by incorrect permissions, file path errors, or incompatible file types. It is important to troubleshoot and resolve these issues in order to successfully run and utilize the Github file on VS code.
  • #1
Arman777
Insights Author
Gold Member
2,168
193
I am doing a cosmological work and I need to run a code form this github page

https://github.com/ja-vazquez/SimpleMC

I download the whole repository as .zip file and I inserted into my desktop. Then I opened it through vs code and this is how it looks like

1614345556927.png
The problem is that, when I run `test_calculator.py` or any other file I get an error

1614345566116.png



Python:
  Initalizing nu density look up table... Done
    Traceback(most recent call last):
    File "c:\Users\Arman\Desktop\SimpleMC-master\test_calculator.py", line 1, in <module >
    from simplemc.CosmoCalc import CosmoCalc
    File "c:\Users\Arman\Desktop\SimpleMC-master\simplemc\__init__.py", line 32, in <module >
    from . import analyzers
    File "c:\Users\Arman\Desktop\SimpleMC-master\simplemc\analyzers\__init__.py", line 2, in <module >
    from .MCMCAnalyzer import MCMCAnalyzer
    File "c:\Users\Arman\Desktop\SimpleMC-master\simplemc\analyzers\MCMCAnalyzer.py", line 10, in <module
    >
    from mpi4py import MPI
    ImportError: DLL load failed while importing MPI: Belirtilen modül bulunamadı.

I guess there's something wrong with the file system. Such that the code cannot use ìmport` properly. But I don't know how to fix it. I am using Windows 10.

Does this happen for other system such as jupyter etc ?

In general how can I run this gihtub files ? Any ideas ? I don't have to use VS Code
 
Technology news on Phys.org
  • #2
I don't use Windows, so maybe I am no help. But I'm surprised you need to download it and unzip it. On a Mac or Unix system you just type git clone https://<name of repository> and it just downloads and creates the whole directory. You mean this doesn't work on Windows?
 
  • #3
phyzguy said:
I don't use Windows, so maybe I am no help. But I'm surprised you need to download it and unzip it. On a Mac or Unix system you just type git clone https://<name of repository> and it just downloads and creates the whole directory. You mean this doesn't work on Windows?
I guess not
 
  • #4
Arman777 said:
I guess there's something wrong with the file system.

If "not having the file needed by the package you're importing" counts as "something wrong with the file system", then maybe. But I don't think that's what you meant.

Arman777 said:
Such that the code cannot use ìmport` properly.

Rather than a basic function of your Python interpreter being broken, which would mean you'd be unable to run any Python code at all, you should consider the far more likely possibility that you're simply missing a DLL that comes with the package mpi4py that the code you're running is trying to import.
 
  • #5
phyzguy said:
You mean this doesn't work on Windows?

You have obviously mistaken Windows for an OS that works. :wink:

There might be a way to install git on Windows that gives you a command line program, but Windows generally wants you to use GUI programs (which its braindead single message queue implementation can then cause to lock up for reasons that should never happen on a so-called multitasking OS, but that's another rant...), and AFAIK most Windows users use whatever git interface is built into their IDEs.
 
  • Like
Likes phyzguy
  • #6
Arman777 said:
I opened it through vs code

Doesn't vs code have a way to clone git repositories?
 
  • #7
PeterDonis said:
that comes with the package mpi4py that the code you're running is trying to import.
I have already downloaded that package.
PeterDonis said:
Doesn't vs code have a way to clone git repositories?
I manage to do it but it does not make a difference

1614354195074.png


This problem to be happened before actually see this post that I have created before

https://www.physicsforums.com/threads/import-a-python-function-inside-a-subfolder.996640/

Let me ask my question in a different way. How you guys download and run this test_calculator.py to work ?
 
  • #8
Arman777 said:
I have already downloaded that package.

Downloaded how? If you didn't install it, either using pip or whatever Windows installer the package's authors provided, it's probably not installed in a way that is usable.
 
  • #9
PeterDonis said:
Downloaded how? If you didn't install it, either using pip or whatever Windows installer the package's authors provided, it's probably not installed in a way that is usable.
1614354685674.png
check this out
 
  • #10
On my Ubuntu laptop, I could run the file test_calculator.py properly. It even gave me this graph:

Figure_1.png

I cloned the repo using git clone https://github.com/ja-vazquez/SimpleMC.git --branch master --single-branch

In order to run the file, you need two packages: mpi4py and deap. You have already installed the former. Have you installed the latter?
 
  • #11
Wrichik Basu said:
On my Ubuntu laptop, I could run the file test_calculator.py properly. It even gave me this graph:

View attachment 278732

I cloned the repo using git clone https://github.com/ja-vazquez/SimpleMC.git --branch master --single-branch

In order to run the file, you need two packages: mpi4py and deap. You have already installed the former. Have you installed the latter?
Yeah I did.. I guess its due to using windows or VS code file system. I guess I need to use something else.
 
  • #12
Arman777 said:
Yeah I did.. I guess its due to using windows or VS code file system. I guess I need to use something else.
I don't think that the file system is the problem. The library mpi4py needs some other non-python dependencies. On Ubuntu, I had to install libopenmpi-dev before installing mpi4py. I thought that this problem is unique to Ubuntu, but a Google search using the keywords importerror dll load failed while importing mpi the specified module could not be found windows shows that you are not the only one facing this problem.
 
  • Like
Likes Arman777 and PeterDonis
  • #14
Yes this seems to be the problem. Let me try
 
  • Like
Likes Wrichik Basu
  • #15
  • Like
Likes Wrichik Basu

What is Github?

Github is a web-based platform for version control and collaboration on software development projects. It allows users to store and manage their code, track changes, and collaborate with others.

What is VS code?

VS code (Visual Studio Code) is a free and open source code editor developed by Microsoft. It supports a variety of programming languages and offers features such as debugging, syntax highlighting, and code completion.

How do I run a Github file on VS code for Windows 10?

To run a Github file on VS code for Windows 10, you will need to first clone the repository onto your local machine. Then, open VS code and click on the "Open Folder" button. Select the folder where you cloned the repository and click "Open". You can now view and edit the files from the repository in VS code.

Why am I getting a file system problem when trying to run a Github file on VS code for Windows 10?

There could be several reasons for a file system problem when running a Github file on VS code for Windows 10. Some common causes include incorrect file paths, file permissions, or conflicts with other programs or plugins. Make sure to check these factors and troubleshoot accordingly.

What can I do if I am unable to fix the file system problem when running a Github file on VS code for Windows 10?

If you are unable to fix the file system problem, you can try reinstalling VS code or seeking help from the Github community. It is also important to regularly update both VS code and your operating system to avoid potential compatibility issues.

Similar threads

  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
8
Views
878
  • Programming and Computer Science
Replies
4
Views
5K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
5
Views
9K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
11
Views
2K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
9
Views
8K
Back
Top