Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Traceback error
#21
Looking back at the error message you had, I now see that you have a virtual environment set up.
This is good, but also the reason that you are seeing errors, and an easy fix.
Virtual environments isolate your project so that is has it's own environment.
You have to install packages within that environment taht will be used by the project.
This keeps the package as small as possible, and also keeps it immune to problems when the system changes.
So, Here's what needs to be done.
with your project loaded in PyCharm:
  • Click file --> settings
  • In the left pane of the settings window, click on down arrow to left of your project
  • In the sub menu that pops up, click Project Interpreter
  • You will see a list of all packages installed in the virtual environment, as well as the selected Python Interpreter.
  • Make sure the proper interpreter is selected, if not select the proper one. If it's not shown (and only if not shown: click on the gear on right, then show all.. Be careful here, and make sure you don't pick an interpreter that is attached to another project, It should be youre base interpreter on your C drive. If its tere, select it and return to settings window by clicking OK. If it's not there, click cancel, gear again, and add local. A new window pops up, select virtual environment new environment, make sure location shows project location, if not make it so. Now set base interpreter to python 3.6 on C drive click ok to get back to settings page.
  • Internet access is required for the following:
  • You will see a list on packages installed to the virtual environment. if you don't see any of the following, they will need to be installed here:
  • BeautifulSoup4
  • lxml
  • requests
  • wxpython
  • If any of these is missing, install as follows: click green + symbol on right
  • For each missing package, type the package name, for example requests. The requests package should be highlighted in the package list, if not, check spelling.
  • once name is highlighted, click Install package
  • when complete, a message highlighted in green saying Package 'requests' installed successfully.
  • repeat for each package, when done X out of window.
  • You should now see all packages in the settings window list, if not go back and get missing package(s)
  • Clock OK on settings window.
  • Try running program again

I will be on and off Friday, but please let me know how you make out. I will respond when I read posts.
Reply
#22
Ok great! There were no errors but nothing happened. I've retired the other versions so we are only working from one module.

As always all help is very much appreciated!
Reply
#23
Was there a populated apis.txt file in the text directory?
This file drives the software, if not there, nothing will happen
again file can be created with notepad, and the format for file is like (with api keys for the files you want to fetch):
Output:
49009201380000 49009230130000 49009278800000
Did you get any error messages?
Reply
#24
Hey Larz60+ - yes the text file is populated with (I think) 100 wells. They are formatted like this: “49009229900000”. Could the quotes be a problem?
Reply
#25
eliminate the quotes
Reply
#26
Done - it had no effect. No errors but nothing magical either.
Reply
#27
It works on my end.
If you want to continue, I think the next step is to:
  • show your directory tree (from start of well_info or whatever you called it.
    like:
    Output:
    well_info/ src/ prog1.py text/ apis.txt
    etc.
  • Post the code as you have it.
Can't think of any other way to proceed.
Reply
#28
C:\Users\toliver\AppData\Local\Programs\Python\Python36\text\apis.txt
C:\Users\toliver\AppData\Local\Programs\Python\Python36\WOGCC_File_Downloadstest.py

I'm going to try this on my laptop at home. I'll see if it's different there too.
Reply
#29
Oh, this is so wrong!

I listed that the text directory had to be directly below the src directory, and you didn't even create a src directory.
the directory structure is extremely important!

This is why I created step by step instructions.

Your programs should never be in the python directory.

I don't even know what issues this may cause.
you are going to have to start over by uninstalling python, reinstalling and then creating a separate work area

It might be possible to create a few programs this way, but just think about this:

what happens next time there is a python upgrade?
All of your old programs will not be able to take advantage of the update.

Don't put any of your code anywhere near the python interpreter!

1. uninstall python 3.6.
Reinstall, following snippsats instructions for python installation here: https://python-forum.io/Thread-Basic-Par...er-Windows

Your programs need to be isolated from the interpreter, and preferably on another drive.

You can go back and follow the step by step instructions for installation of the programs.
Reply
#30
Ok - can you give me your paths? The only path I have with that configuration is the one we were working with before we came back to this one. Can you post your code as well? Hopefully, if I have your code and I set it up with your path it will work for me as well? What is your OS?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Traceback error tjnichols 3 5,370 Sep-11-2018, 07:04 PM
Last Post: tjnichols
  Traceback error tjnichols 3 3,579 Sep-05-2018, 06:11 PM
Last Post: tjnichols
  Traceback error - I don't get it tjnichols 2 3,116 May-24-2018, 08:10 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020