Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
Am new to Python and looking for a solution to read/write xpt file(SAS data set) using Python.
I got to know its possible using Python from this link. But then the code is not working as expected. Anything missing in this code, whether to include any library or to install any library. Or even any syntax error in this code.
with open('example.xpt', 'rb') as f:
for row in xport.Reader(f):
print row
Note: Am familiar with PHP scripting.
Please help me with suitable solution.
You need to import the package to use xport
Import xport
And have to install the package by
sudo pip install xport
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I have installed multiple modules using pip but I can't access any of them. I can check and see that the modules are installed using pip list, but when I try to access them in python I just get ModuleNotFoundError no matter what. I can't find any help anywhere online and honestly just want to stop learning python because I have so many problems like this every day.
There seemed to be two different locations python was installed to. Problem solved by moving f2py.exe to the proper location and setting the proper PATH locations.
Don't give up! Python is great. I think you've installed the modules in an environment which might not be the same your code uses at runtime.
At the top of your code try to add:
import sys
print(sys.path)
You might notice that your code uses another location.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Can someone help me fix this issue:
File "/Users/mac/PycharmProjects/NoteBot/main.py", line 5
PATH =
^
SyntaxError: invalid syntax
I think you are trying to run the PS5 bot using the inbuilt python that comes on your mac, i.e., probably Python2.7.
The issue is the author of the bot used a feature introduced in Python 3.5 called type hints.
So you need to change the version of Python that Pycharm is using to a version above 3.5 (google this). Or just run the script from the Terminal app using:
python3 /Users/mac/PycharmProjects/NoteBot/main.py
Note: You may need to install selenium etc. again here using pip3. Pycharm probably will handle this for you if you get it to point at a Python3 installation.
Furthermore, if you want to learn to program in Python yourself after you snag a PS5 you may want to look into pyenv.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Does anyone know how to fix this?
i already did pip install python-decouple on my terminal, but vscode keep saying that is unable to import.
You may want to check which environment your vscode is using
https://code.visualstudio.com/docs/python/environments
If you did pip install python-decouple in a virtualenv, then you need to point the vscode python interpreter to that environment.
To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
It is telling me that "install" is an unresolved reference??? I have tried all of the suggestions presented, and this is frustrating as I am attempting to finish a course.
Run:
python -m pip install requests
It appears that you are in Python console and trying to install it in there. That is possible with iPython console using !:
!pip install requests
or using subprocesses(which is just overkill). Running in CMD.exe, or Powershell, assuming Python is on your Path, ought to work.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I have imported 'langdetect' library in python 3.4.4. This is working successfully in python 3.4.4 shell but when I create a new .py file then it does't work successfully. It shows that ImportError: cannot import name 'detect'. How I solve this problem.
It looks like you have named your own file langdetect.py and then tried to import langdetect. This makes it try to import itself. Rename your file to something else, like testdetect.py.