Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot launch the project #3

Open
francoiscoiscois opened this issue Oct 8, 2023 · 1 comment
Open

Cannot launch the project #3

francoiscoiscois opened this issue Oct 8, 2023 · 1 comment

Comments

@francoiscoiscois
Copy link

Sorry to bother you, I am a total noob in programming.

I have autogen installed and was able to run a simple script with it.
I wanted to install your project. Downloaded it and copied it. Run it in pycharm.
Unfortunately if I run IterativeTools.py it doesnt find autogen library. Do you know how to find the library and input it in your project so I can run it ? Sorry, I feel it is really basic but I am totally lost with runing code with an IDE, it is my first time.

Here is the message error I got

Traceback (most recent call last):
File "D:_CODING-PROJECTS_\AutogenB\AutoGen_IterativeCoding-main\IterativeTools.py", line 1, in
import autogen
ModuleNotFoundError: No module named 'autogen'

Thank you!

@Andyinater
Copy link
Owner

Andyinater commented Oct 9, 2023

No bother! Don't feel bad - this is one of the many weird things to wrap your head around when getting into coding for the first time. It took me a while to figure it out, but this is what I do to get it working 9/10.

When you install python, there are many different ways it can be installed. For instance, you mention pycharm - this is some IDE like VSCode from what I can find. Generally, these are very powerful, but they have so many nobs and dials it is more of a hindrance for new users. What I like to do is go to the official python downloads page and select not the newest option - sometimes new has new bugs :P For instance, I am on 3.10.13 right now. Be mindful that eventually it will fall out of security updates and then you may be potentially exposed. I go to the oldest one that still has an installer, and in this case that is 3.11.15.

Download the installer and click through the menus - I can't recall the exact steps, but automatic/recommended are probably ok. It is the next step that normally stumps people.

After it is installed, go to the folder where it is installed. You are looking to find the 'python.exe'. You should see other files and folders, particularly a folder named Scripts - inside there is 'pip.exe', the other critical file. Keep track of both of those directories.

Before we do anything, open your command prompt. Just type cmd in the search bar and it should come up. Run it, and just type in python. Odds are, it will say not found/recognized or something (or it opens the windows store... shudder). pip will do the same thing. These are installed, but the computer can't find them. You need to tell it where they are, and you do this by using something called the Path environment variable.

In your search bar, start typing environment variable. You'll see 'edit the system environment variables' or something like that. Open that. On the advanced tab, at the bottom right, "Environment Variables...". Click that. In the top box and the bottom box you can find variables named Path. Honestly - I'm not sure which is the right one. You can start with the top one - click Path so the whole row highlights, then click Edit.

This is a list of some of the directories that your computer searches when you type a command in command prompt. Click new, add the directory that had 'python.exe'. Click New again, and do the one for 'pip.exe'. Hit Ok 3 times to end up closing all the windows.

OK - if it went well, you open up a new command prompt, and both pip and python will do something. If not - try the other path variable maybe. NOW, you can do the install instructions for autogen pip install pyautogen - right in your command prompt. It should get installed and properly associated with your python install. You can try running python right in the command prompt and try import autogen and it should hopefully return nothing - that means it worked.

Now, for my repo, it is a slightly advanced use of python in that it isn't a single script file (in the scheme of things I am actually still a complete noob too). I have a main.py which is kind of like the main script file. And then there is IterativeTools.py, which holds all the code I put together to try and get this thing to do what I want. Make sure they are in the same directory as eachother, open command prompt IN THAT DIRECTORY (you can do this by typing 'cmd' in the address bar of explorer, it should open a command prompt session right in that directory - no annoying navigating).

And from there, python main.py should start it up. It'll make a folder to hold your projects and ask you what you want to start and name it. Hopefully you get to this point and it works.

It can't code extremely complex things, but if you keep it simple enough it normally gets it quickly. Have fun with it. Always reach out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants