I'm currently using VS Code with Python. No matter what I seem to do, when I type a command into terminal (even something simple like print("hello")), I get the following error: zsh: missing end of string
I've done some research online and can't find a good fix. I'm using Conda, but have also tried on the 'recommended' interpreter (Python 3.8.9 64-bit) and am having the same issue.
Any help would be much appreciated!
Related
Good morning everyone,
MacBook Air 2017.
I am new to code, and I have just started to learn a few lines of Python. I had installed version 3.8 a few months ago, and now I have started learning a bit more seriously. I found out about the pip command, but trying to install the docx pip through "pip install python-docx" showed me an error.
To be completely honest, I started to watch on the internet how to fix this problem, but I didn't really understand what I was doing. I tried to install Pyenv to somehow correct the error by making Python 3.9.4 the default version for the Mac, following this website https://opensource.com/article/19/5/python-3-default-mac. I tried to modify the .bash trough "touch ~/.bash_profile; open ~/.bash_profile", hoping this would somehow fix the issue following How do I edit $PATH (.bash_profile) on OSX?. In the end, I just decided to uninstall both 3.8 and 3.9.4 to somehow start again through https://apple.stackexchange.com/questions/284824/remove-and-reinstall-python-on-mac-can-i-trust-these-old-references, but nothing happened. At this moment in time, I have no clue what happened and if somehow I have made things even worse (which I probably did).
Right now, whenever I use any command with pip an error comes up, and I don't know how to fix it in order to be able to use modules & pip in Python. The error could be the same as the following one that I have attached to the post, which comes up after writing commands in terminal:
Image with a few errors
Thanks a lot, Bye.
tried re-installing more than once. tried opening from cmd and get the following error: python error
Am new to programming so stuck trying to solve this.
things tried: re-installing (user only, all users), previous version 3.8
things i know: a previous software seems to use python files under 2.8 something.
any help is much appreciated.
Thanks
Windows 10, Python 3.8.5, using Mu 1.0.3. I am trying to install new modules. I just started learning python this weekend so I am pretty clueless. There does not seem to be much online that addresses this problem, unless I just don't know the right words.
I have tried going to command line and entering set PYTHONPATH="[a list of all paths that came up in response to printing sys.path]". The command line seemed to accept this, since it did not give me an error message. But Mu still gives me a
ModuleNotFoundError: no module named "modulename".
I have additionally obtained just the location of the module by typing its name into the shell, and then attempting sys.path.append("path"), in both Mu and the shell. I get the same ModuleNotFoundError.
So, how do I get the code editor to find modules? And, how do I make it a permanent fix?
As per this article the Mu editor has its own Python environment, separate from the one that typical Python installations have
Due to this, to be able to use them on Windows, we have to install our requirements into a specific location:
pip install –r automate-win-requirements.txt --target "C:\Users\USERNAME\AppData\Local\Mu\pkgs"
I was smoothly working on my terminal having a good time and suddenly I don't know exactly what I did but now instead of the prompt having the regular directory path it now displays (With a percentage sign that I had never seen before):
emilio#Emilios-MacBook-Air-3 ~ %.
It's so weird because it just suddenly changed and now I can't run my Files correctly.
I was doing a project using Pillow and now the terminal prompts:
ModuleNotFoundError: No module named 'PIL'
Before this, I was using the file perfectly in the terminal and it never displayed such an error. I already looked up the problem on the internet but coudn't find the solution.
Your help would be great
In the upgrade to Catalina apple replaced bash with zsh
I think the solution for you will depend on which python distribution you have but there are a few stack overflow questions already that deal with this for the conda distribution, e.g. Conda not found after upgrading to macOS Catalina
and Can't find pip, conda, python modules after OSX Catalina update
Even if you are using another distribution, there might be something in there that is useful.
You may also be able to temporary or permanently switch back to bash with something like exec bash -l
I've run into a strange problem.
I built VTK with python wrappings on cent os 6.5.
On importing vtk it gives me PyUnicodeUCS2_* error. I checked python used for the build for unicode setting with sys.maxunicode. It is UCS4. I searched for this error and found that the error occurs when the VTK is built using UCS2 python. But, This is not the case in my case. What could be the reason for error?
The python that I'm using is picked from some other machine . If I run maxunicode on original previous machine it shows USC2. The same python (I copied the whole folder python2.6) on the other machine where I'm building VTK, shows maxunicode as UCS4. I think this has something to do with the problem.
Please help.
This error is caused by using an extension built by a UCS2-based Python interpreter with a UCS4-based interpreter (or vice-versus).
If you built it using the same Python interpreter then something is confusing in your build environment.
I tried to compile VTK with my python build several times. Checked the various paths in CMAKE to avoid conflict with system python. Still couldn't get rid of the error. Finally, I built the python with --enable-unicoe=ucs2. That solved the problem. Thanks for the help though.