774 questions
1
vote
0
answers
82
views
Pycharm fails to find package in the defined PYTHONPATH
I have a Python monorepo. One of the services in this monorepo is "poller-service". Its general structure is:
services/
└── poller-service/
├── .venv/
| └─ ...
...
0
votes
0
answers
56
views
why won't Pycharm accept my file location for Pythonpath?
I am configuring my robot framework on a project level and am trying to enter my project file location as the pythonpath. Next to the field is this text:
Entries to be added to the PYTHONPATH
(used ...
2
votes
2
answers
183
views
Persistent ModuleNotFoundError: No module named 'src' in Python Project
I'm working on a Python project with the following structure:
/
├── src/
│ ├── __init__.py
│ ├── afrr/
│ │ ├── __init__.py
│ │ ├── dumper.py
│ │ └── cleaner.py
│ ├── config.py
│ ├──...
0
votes
0
answers
161
views
How should I manage multiple versions of a library in a Python project
I am working on a Python project, which has to support multiple versions of the same package.
For each new version, some of our wrapper classes change, and others remain unchanged from the previous ...
0
votes
0
answers
156
views
Visual Studio Code python .env file to work for both Windows and Linux
I want to use exactly the same vscode workspace folder on both Windows and Linux.
As you may know, contrary to Pycharm, the root folder is unfortunately not included in the python path. So for my ...
0
votes
1
answer
201
views
Setting PYTHONPATH in Eclipse/PyDev
Added later: I stupidly capitalized OS rather than using os, so the import and print now works properly. However, the question remains: how can I add a source directory that is outside the project ...
1
vote
1
answer
105
views
How to include the project root folder into PYTHONPATH when running python script in sub folder
Here's my project structure
- folder_1
- folder_2
- file1.py
- file2.py
- folder_3
- file3.py
Now I use this command to run file1.py
python folder_1/folder_2/file1....
0
votes
1
answer
164
views
Run & Debug depends on Windows PYTHONPATH/HOME environment variables
I'm working on a project where I debug with GDB and OpenOCD. Sometimes we use VS Code for this purpose and I encountered an issue that the Run & Debug session won't launch when PYTHONHOME/...
0
votes
1
answer
30
views
python: NON-pipadmin user gets ModuleNotFoundError after pipadmin installs ipython
Not a question, sharing something that worked for me:
Two linux users, both in the same "programmers" linux group.
1st user is pipadmin, and does "pip install ipython" to a local ...
0
votes
1
answer
47
views
invoking a python script from the command line leads to “[Errno2]" - PYTHONPATH is set
Ignorant new Linux/Ubuntu/StackOverflow user here.
I have my scripts for users to run in a path like /home/user/Projects/scripts/. If that is the pwd, I can invoke a script like this:
~/Projects/...
0
votes
0
answers
94
views
Running different python environments within python script in linux
For my Uni thesis project, I need firstly to setup automatically multiple github repositories within python script. Problems I am facing is that:
each repository has its own requirements and some of ...
1
vote
0
answers
65
views
how do I guide pabot to find my custom libraries or APIs?
I am using Pabot of Robot Framework. I have created a whole application that in background runs the Robot Framework.
This exe understands the path which I mentioned during pyinstaller. So it opens up ...
1
vote
0
answers
330
views
PyCharm "Interpreter Paths" -- What are they and where are they stored?
I have a PyCharm project, named pycharm_projects. In it, I create a virtualenv Python interpreter, example_virtualenv. Then I click Interpreters -> Show all -> example_virtualenv -> Show ...
0
votes
1
answer
314
views
Visual Studio Code working with Python with PYTHONPATH and separate source and tests folders
Given a project structure:
* project
* src
* my_package
* __init__.py
* code_file.py
* tests
* __init__.py
* my_package
* __init__.py
* code_file_test.py
How ...
0
votes
1
answer
1k
views
Use Windows cmd to set PYTHONPATH for embedded Python interpreter
I am using Windows batch as the entrance for users to run a Python script for some simple automation requests. I have referred to the answer. Assuming I have used another batch to copy the embedded ...
0
votes
0
answers
515
views
Unable to call Python method from Robot Framework: No keyword with the name 'method_name' was found
I'm facing an issue when trying to call a Python method from a Robot Framework test case. I have the following Python method defined in a file named campaign.py:
def print_something_test(self, text): ...
0
votes
0
answers
46
views
Setting up a Python environment to point to a modules directory on a Mac
I'm trying to set up a local development environment for Python. We use BitBucket for source control of Python modules we've developed for our company. On my machine I have this folder/directory set ...
0
votes
0
answers
1k
views
Python Imports - How to avoid sys.path.append
I have a bug with imports in python I’m having a hard time to solve or even understand why it happens.I didn’t write the codebase so please forgive the fact that absolutely zero python naming ...
1
vote
1
answer
266
views
Python: xlwings and sub directories
I have 2 functions. I want to check if a file exist in a sub directory.
def XlCall():
wb = xw.Book.caller()
from pathlib import Path
entries = Path('./History/data.csv')
wb.sheets('TA')...
0
votes
1
answer
310
views
How can numpy uninstall error in python 3.8?
I want to uninstall numpy in Python 3.8. I tried to that command "pip3 uninstall numpy",but this didn't work. I modified the PYTHONPATH in my ~/.bashrc file and exported PYTHONPATH, but ...
0
votes
1
answer
50
views
How to get pythonpath to work for the python module in openmodelica Buildings running ubuntu 20
I am having problems running my model in openmodelica on ubuntu 20. I tried exporting the path following the documentation and installed libpython3.8-dev.
https://build.openmodelica.org/Documentation/...
0
votes
2
answers
288
views
cannot setup PYTHONPATH environmental variable in vscode
I tried to set up PYTHONPATH environmental variable in vscode in Mac, and it does not work. VScode version: Version: 1.78.1 (Universal), Mac os: 13.3.1 (a)
I followed the instruction:
https://code....
0
votes
0
answers
138
views
Python pytest Exclude Test Directory in PYTHONPATH
I have a weird scenario with pytest where we need to exclude the test directory from PYTHONPATH during the test.
Context
The pytest command for reference
python -m pytest main_project_a/folder_a/...
2
votes
2
answers
2k
views
Pip installs packages in the wrong directory
So I want to install the opencv-python package. I typed in pip install opencv-python and got this:
Collecting opencv-python
Downloading opencv_python-4.7.0.72-cp37-abi3-win_amd64.whl (38.2 MB)
━...
1
vote
1
answer
3k
views
ModuleNotFoundError: No module named 'openvino'
I'd like to run some official OpenVINO samples, but I always get the following error:
from openvino.inference_engine import IECore
ModuleNotFoundError: No module named 'openvino'
I created a simple ...