This feels like a crap question but I am too new to know what details to look for or include. I've been using python less than a month for data analysis, and was told that I would likely find the combination of Anaconda and PyCharm helpful, and I have.
Recently Pycharm was updated to 2018.1 and since then my imports on new projects don't seem to be working properly.
i.e. I use pyodbc for some data import. I literally copy pasted the code from a prior project and then installed the package (ie right click install pyodbc which completes "successful"). I am getting
"pyodbc.Error: ('HY000', 'The driver did not supply an error!')"
For giggles I built new sub scripts in the old project files and duplicated them in the new project files, they work in the old but not the new.
Any help would be appreciated.
Related
Since last many months I was using intellij idea comfortably but suddenly something went wrong and all my existing projects are not running now. I have the python virtual environment in SDK section along with all the libraries. see here but then also my programs are not working at all. [](https://i.stack.imgur.com/Ck9Bi.png)
See this
some days back All these programs were working perfectly fine. I need help. This is very frustrating.
unfortunately, there is not enough information to provide a proper solution. Please get in touch with IDE support via Help | Contact support...
What I get when I try to run it
Nothing I'm trying to import is being recognized by the IDE. I do have to admit, I am a fairly novice programmer, and the process of successfully importing external modules (, the ones that don't come with python,) is very confusing to me right now. But from everything I could scrap online, it seems like for VS 2022 I first have to go to [TOOLS] > [PYTHON] > [PYTHON ENVIRONMENTS]. Then from the environments popout I select my python version (, which is 3.10 (64-bit),) update my pip if not already up to date, search for my desired package and download. The terminal said the download completed but the IDE still can't find the import.
My installed packages in my python environment
This is a problem I've been putting off for months, and in the past I downloaded the packages through the Windows command prompt instead of the IDE. I'm not sure if it's any different, I'm not sure if one is more right. The result was the same regardless, it didn't work. And after several uninstalls and reinstalls, I even tried moving the entire package folder into my project folder to see if anything would change. The import was accepted but something in the packaged errored out. Moving files like that doesn't seem like the correct way anyway, I just want to make sure I bring up everything I tried to fix this.
I suspect that solution is something super simple that I'm just overlooking or don't know. I still kind of think the package needs to be with my .py file in some way but I'm unsure. If you can save me I'd appreciate it because I've been stumped for a while now.
I know my code is super simple, but I just wanted to show the error. I get the error before it prints.
I'll preface this with that until last week, my entire experience with linux can be summarized by some long-forgotten class in school 10 years ago, plus my recent use of Git Bash on Windows. Bear with me!
I've recently started working with GCP to do data-sciency stuff. I created a VM instance to load and process a bunch of data using a Python script I wrote.
However, when I start the instance, I see that it's using Python 2.7, so I naturally tried to figure out how to install or update Python. www.python.org said that I'd likely have to build the library from source code, so that's what I learned how to do (thanks SO).
Now, as I'm trying to run my script, I keep getting errors due to missing modules. A little research told me that these are core library modules that are missing... As in they should be part of my Python environment already. So I keep pip installing these missing modules, but each and every time, I have to re-build Python from scratch in order for the newly installed modules to be recognized.
Let's just say, that's not fun for a Windows los... user.
So, how do I get a Python distribution that has all the regular libraries already installed, like I would on Windows?
So I was trying to modify an existing library and instead of doing it the smart way and using pip -e I instead just installed the libraries, then swapped the modified files for whatever changes I wanted. For example if I had:
Library A/
---doSomethingA.py
---otherFiles.py
I just deleted doSomethingA.py and replaced it with my version of doSomethingA.py. Theoretically I figured, because im editing the file locally, it should still work as planned for my library with whatever extra functionality I want.
HOWEVER.... its basically going crazy. While I can see my edited changes in the file, when I run the library its obviously not running that file. I did things like:
commenting out the whole file (still runs somehow)
Actually uninstalling the library and part of another script using doSomethingA.py it still runs?? (i.e Something like import libraryA works on JupyerHub, but not on the putty terminal... ?)
I've obviously come to the conclusion that its not running the file that it says that it is (and trust me I've checked the path of the file like 10 times).
My question is:
How is this possible? What are the places that python would store another copy of the file etc?
I've also deleted the __pychache__, but I can't think of anything else to do. Is my best option to just give up and create a new virtual environment, etc?
I understand that you are running on jupyter hub.
This means that your python is running remotly on the server and the framework is taking care to synch your local project (but not the installed libraries).
The python on the server is not aware of your local change.
As a temporary mitigation you can copy the installed library to you project root.
I am trying to create a database that I can then read from / write to in Python. I've tried installing the recommended dev installation via this https://dev.mysql.com/downloads/windows/installer/8.0.html. I then went into the designer and added a table with some entities. However, the UX in MySQL is really terrible and I can't work out how to actually view the table in the database I've just created and add test values or whatever. I got frustrated and uninstalled MySQL completely because either I downloaded it incorrectly (I selected dev machine but I want to develop and run it on this machine, was that the wrong option?) or it's just terrible to deal with. However, it seems like there are no real alternatives unfortunately and so I would appreciate some help with regards to just setting up a simple database and connecting it to Python so I can perform SQL statements from my Python code. Also, another complication is that my normal Python installation (i.e. the one linked to PATH etc.) is 3.6, but I was forced to install 3.7 when I downloaded MySQL so I'm not really sure how that will work.
Thanks.