on MAC OS X, py.test not recognized as a command

On MAC OS X 10.10; I installed pytest 2.6.4; however in Terminal If I write py.test or even py.test --version; I get the error: -bash: py.test command not found (a) Am I missing anything? What...

py.test fails due to missing module

I would like to write a test, but this test will pass only if the nlopt module is installed. Since this module is optional, I was wondering if there's a way to write a test that won't prevent...

pytest cannot find module

I am following the pytest good practices or at least I think I am. However, pytest cannot find my module. It seems not to include the current directory in its PYTHONPATH. The source file: def...

Gitlab CI Python run test - ModuleNotFoundError: No module named xxx

I saw a lot of questions about importing modules error but I could not manage to solve the problem with Gitlab CI pipeline. My project...

Unable to connect to docker postgres container with pytest

I am trying to use pytest to run some simple integration test against postgresql db. I have to use python 2.7 so testcontainers are not the option. my conftest.py looks like: import pytest import...

Using my package throws ModuleNotFoundError: No module named 'my-package' in Travis

I am trying to use Travis CI for continuous integration but have been dealing with a lot of issues since it is my first time with Travis. Lately, I am running in to the following build...

Gitlab-CI for Python project with SonarQube

I want to set Gitlab-CI for my python project with SonarQube. I have one problem with that. I set SonarQube variables in settings gitlab-ci. This is my gitlab-ci.yml file: variables: ...

Msys2: Maintaining two python installations

I am using Msys2 portable under Win 10. I have 2 python 3.8 installations. The original question asked if that is so. I am now certain it is, so for the time being I want to deal with their...

DjangoCMS TypeError: from_db_value() missing 1 required positional argument: 'context' after upgrade to 3.7.2 w/ Django 3.0.1

I had a working DjangoCMS application running DjangoCMS 3.7.1 and Django 2.2, however after I just bumped the DjangoCMS version to 3.7.2 and with it, Django to 3.0.1, I am now getting a render...

Get error when i add a new library to my pipfile and run docker-compose

Hi i add a library pyodbc into my pipfile, when i run the command docker-compose up app-name and run the dockerfile config i get an error when try to install dependency from pipfile.lock my python...

cannot import name 'UnpickleError' from rq.exceptions

I get an error when i run my image with docker-compose this is my pipfile with the library rq i try to up the image but i get an error in django-rq, but i not change this library i only add in my...

ImportError: Couldn't import Django after running " heroku python manage.py migrate" in CMD

I have a following error after running " heroku python manage.py migrate " in CMD. C:\Users\ky2001\Desktop\my_app>heroku run python manage.py migrate Running python3 manage.py migrate on ⬢...

Handling secrets at build time for the purposes of unit & integration testing containers deployed to Cloud Run

Use case [For docker containers deployed to Cloud Run], run unit tests at build time, some of which require secrets and some level of google authentication. The unit tests might require...

gcloud crashed (OSError): [Errno 2] No such file or directory: '/workspace/env/bin/python3.7'

When trying to deploy my fastapi python service (on App Engine), I'm running into the following error in the deploy step:ERROR: gcloud crashed (OSError): [Errno 2] No such file or directory:...

How to setup PYTHONPATH env in VScode properly

The project structure is like - a.py - unittest - test_a.py A.py class A(): def function_a(self): return 'function_a' test_a.py from a import A class TestA(): def...

Coverage.py only detects calls during import, not during test execution

I cannot get coverage.py to correctly measure code coverage for my Python package. Whatever I try I only get coverage for the code run during import, i.e. package/__init__.py and code called from...

How to integrate with pytest ('test discovery fails')?

I'm unable to integrate my project's unit tests into VSCode. Test discovery fails because source files are not recognized by pytest. (Just for clarification, this is a question about VSCode, not...

When should I use pytest --import-mode importlib

This is my project structure: git_dir/ root/ __init__.py tests/ __init__.piy test1.py foo_to_test/ foo.py I'm using pytest to test...

Tkinter Callback and Trace Back Issue and Jupyter Notebook Issue

So the below is a GUI interface using Tkinter where I'm trying to call basic functions after pressing the button, the issue is that when I'm executing this in the Jupyter Notebook, the program...

'no module named pip' when running tox

I have a simple tox file running basic python unit tests that I'm trying to run against multiple python versions. [tox] envlist = py36, py37 [testenv] setenv = PYTHONPATH = {toxinidir} I...

Coverage - PermissionError: [Errno 1] Operation not permitted

I using pytest and coverage modules for test cases and code coverage. From the project root, I'm able to execute pytest -v but not pytest -v --cov=./ (stack trace below) I set PYTHONPATH to the...

ModuleNotFoundError: No module named 'pyarrow' from dockler image with Alpine Pyspark

I have built an image from: https://archive.apache.org/dist/spark/spark-%242.4.4/spark-%242.4.4-bin-hadoop2.7.tgz Once is downloaded, I do: cd spark-2.4.4-bin-hadoop2.7 && bin/docker-image-tool.sh...

cannot run pyinstaller executable of a flask server. ValueError: Can't find a dictionary for language 'ru'

I'm trying to put a simple flask server into executable by using pyinstaller -F server.py command When running the exe file, I obtain the following error: Traceback (most recent call last): File...

SAM app works but running pytest throws...ModuleNotFoundError: No module named 'aurora'

I've resisted writing this post for over a day because I was determined to find a solution from one of the many posts out there with answers to similar issues but none of them seem to work. My...

How can I convert big python project to exe file?

I have a Python Qt GUI which is using these modules: "Numpy, scipy, matplotlib-base, netcdf4, cartopy, xarray, pytest, gdal, cycler, dateutil, kiwisolver, pillow, pyparsing, tk, PyQt5, pycairo,...

Permission Denied docker Mac Os M1

I'm extremely new to docker and I keep running into "permission denied" issues. I was able to build an image using the following docker file: FROM tensorflow/tensorflow:latest ENV...

zsh (mac big sur) Can't Recognize pip install

I recently started using zsh with oh-my-zch. I then ran into trouble of not able to do simply pip install command. I checked the version: it shows 2.7.16 for 'python --version' and '3.8.2' for...

Install pydrill in Docker image

I have this docker file based on alpine that installs several packages with conda. At the end installs pydrill with pip as there's no conda installation. from jcrist/alpine-dask RUN...

ERROR: file not found when using pytest with VSCode (macOS)

I am trying to run a single unit test within VSCode by clicking Run Test (or Debug Test) above the unit test in the editor field, but I keep getting an ERROR: file not...

Dockerfile & Poetry | executor failed running [/bin/sh -c poetry install --no-dev]: exit code: 1

Background Originally, I had this post on Unix & Linux; regarding adjusting my system clock. Solved by: sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' '...