#๐ i have feedparser installed bnut it somehow doesnt get recognized by my code?
22 messages ยท Page 1 of 1 (latest)
@ruby patrol
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Share the error message as text please
PS C:\Users\sunuy\OneDrive\Desktop\Switch CFW Bot> & "C:/Program Files/Python312/python.exe" "c:/Users/sunuy/OneDrive/Desktop/Switch CFW Bot/cogs/nintendo_news.py"
Traceback (most recent call last):
File "c:\Users\sunuy\OneDrive\Desktop\Switch CFW Bot\cogs\nintendo_news.py", line 3, in <module>
import feedparser
ModuleNotFoundError: No module named 'feedparser'
PS C:\Users\sunuy\OneDrive\Desktop\Switch CFW Bot>
type py -m pip install feedparser
bro that worked
omg, how did you know that?
I was now 2hours searching online about different solutions
practice
thanks so much!
also learn to use virtualenv
Virtual environments are isolated Python environments, which make it easier to keep your system clean and manage dependencies. By default, when activated, only libraries and scripts installed in the virtual environment are accessible, preventing cross-project dependency conflicts, and allowing easy isolation of requirements.
To create a new virtual environment, you can use the standard library venv module: python3 -m venv .venv (replace python3 with python or py on Windows)
Then, to activate the new virtual environment:
Windows (PowerShell): .venv\Scripts\Activate.ps1
or (Command Prompt): .venv\Scripts\activate.bat
MacOS / Linux (Bash): source .venv/bin/activate
Packages can then be installed to the virtual environment using pip, as normal.
For more information, take a read of the documentation. If you run code through your editor, check its documentation on how to make it use your virtual environment. For example, see the VSCode or PyCharm docs.
Tools such as poetry and pipenv can manage the creation of virtual environments as well as project dependencies, making packaging and installing your project easier.
Note: When using PowerShell in Windows, you may need to change the execution policy first. This is only required once per user:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
I know its a big read but its worth it as its best practice
I started 2 months ago with coding and get a bit frustrated somehow as it seems almost impossible to get to a decent level. DO you think lerarning coding does still make sense if I ever want to do money with it, you seem to be a right person to ask
Learn the fundamentals of programming. Coding in whatever programming languages will follow the same principles
is it possible to get a job with only the basics as knowledge?
no. you need to build a few projects as your portfolio
Virtual environments are isolated Python environments, which make it easier to keep your system clean and manage dependencies. By default, when activated, only libraries and scripts installed in the virtual environment are accessible, preventing cross-project dependency conflicts, and allowing easy isolation of requirements.
To create a new virtual environment, you can use the standard library venv module: python3 -m venv .venv (replace python3 with python or py on Windows)
Then, to activate the new virtual environment:
Windows (PowerShell): .venv\Scripts\Activate.ps1
or (Command Prompt): .venv\Scripts\activate.bat
MacOS / Linux (Bash): source .venv/bin/activate
Packages can then be installed to the virtual environment using pip, as normal.
For more information, take a read of the documentation. If you run code through your editor, check its documentation on how to make it use your virtual environment. For example, see the VSCode or PyCharm docs.
Tools such as poetry and pipenv can manage the creation of virtual environments as well as project dependencies, making packaging and installing your project easier.
Note: When using PowerShell in Windows, you may need to change the execution policy first. This is only required once per user:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.