My folder structure is:
.
- test/modules
| - parseTests.py
The source of parseTests.py is copied and pasted from here (Unittest Basic Example).
When I run python -m unittest, no tests are found.
When I run python -m unittest ./modules/tests/parseTests.py, I receive the following error:
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/__main__.py", line 18, in <module>
main(module=None)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/main.py", line 100, in __init__
self.parseArgs(argv)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/main.py", line 147, in parseArgs
self.createTests()
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/main.py", line 159, in createTests
self.module)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/loader.py", line 220, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/loader.py", line 220, in <listcomp>
suites = [self.loadTestsFromName(name, module) for name in names]
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
ValueError: Empty module name
What am I doing wrong?
Related
This is the command I am running from powershell:
whisper C:\Users\SAMSUNG\Desktop\aud2.mp3 --language Urdu --task translate --model base
This is the complete error:
UserWarning: FP16 is not supported on CPU; using FP32 instead
warnings.warn("FP16 is not supported on CPU; using FP32 instead")
Traceback (most recent call last):
File "c:\users\samsung\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\samsung\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\SAMSUNG\.envs\py3.7\Scripts\whisper.exe\__main__.py", line 7, in <module>
File "C:\Users\SAMSUNG\.envs\py3.7\lib\site-packages\whisper\transcribe.py", line 307, in cli
result = transcribe(model, audio_path, temperature=temperature, **args)
File "C:\Users\SAMSUNG\.envs\py3.7\lib\site-packages\whisper\transcribe.py", line 84, in transcribe
mel = log_mel_spectrogram(audio)
File "C:\Users\SAMSUNG\.envs\py3.7\lib\site-packages\whisper\audio.py", line 111, in log_mel_spectrogram
audio = load_audio(audio)
File "C:\Users\SAMSUNG\.envs\py3.7\lib\site-packages\whisper\audio.py", line 44, in load_audio
.run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)
File "C:\Users\SAMSUNG\.envs\py3.7\lib\site-packages\ffmpeg\_run.py", line 320, in run
overwrite_output=overwrite_output,
File "C:\Users\SAMSUNG\.envs\py3.7\lib\site-packages\ffmpeg\_run.py", line 285, in run_async
args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream
File "c:\users\samsung\appdata\local\programs\python\python37\lib\subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "c:\users\samsung\appdata\local\programs\python\python37\lib\subprocess.py", line 1155, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
I am having a problem with pyinstaller with python 3.10.5 on Ubuntu 18.04. I built Python 3.10.5 from source.
When I run pyinstaller with 3.10 I get the error below. When I run with 3.6 I get:
08:32:09 44362 INFO: Python library not in binary dependencies. Doing additional searching...
08:32:09 44394 INFO: Using Python library /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
Looking on my machine there is no libpython3.10m.so, so I wonder if this is the problem? (There is a libpython3.10.a)
Would having a libpython3.10m.so fix the problem?
Where do I get one from or how do I build one?
pyinstaller/python 3.10 errors:
INFO: Python library not in binary dependencies. Doing additional searching...
Traceback (most recent call last):
File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/__main__.py", line 134, in <module>
run()
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/__main__.py", line 124, in run
run_build(pyi_config, spec_file, **vars(args))
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/__main__.py", line 58, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/building/build_main.py", line 782, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/building/build_main.py", line 714, in build
exec(code, spec_namespace)
File "/home/jenkins/workspace/TOOLS/tools-helper-build-python3-linux/hosttools/python/maxwell_dm.spec", line 7, in <module>
a = Analysis(['maxwell_dm_gui/app_entry.py'],
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/building/build_main.py", line 277, in __init__
self.__postinit__()
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/building/datastruct.py", line 155, in __postinit__
self.assemble()
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/building/build_main.py", line 501, in assemble
self._check_python_library(self.binaries)
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/building/build_main.py", line 605, in _check_python_library
python_lib = bindepend.get_python_library_path()
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/depend/bindepend.py", line 897, in get_python_library_path
python_libname = findLibrary(name)
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/depend/bindepend.py", line 775, in findLibrary
lib = _which_library(name, paths)
File "/home/jenkins/.local/lib/python3.10/site-packages/PyInstaller/depend/bindepend.py", line 806, in _which_library
for _path in os.listdir(path):
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib64'
Hey guys I am trying to open Jupyter Lab and install some packages from the command line and I get the following error, it looks like python is being used by other process.
Traceback (most recent call last):
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 92, in _tempfile
os.write(fd, reader())
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\importlib\abc.py", line 371, in read_bytes
with self.open('rb') as strm:
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\importlib\_adapters.py", line 54, in open
raise ValueError()
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\Scripts\jupyter-lab.exe\__main__.py", line 4, in <module>
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab\labapp.py", line 15, in <module>
from jupyterlab_server import (
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab_server\__init__.py", line 5, in <module>
from .app import LabServerApp
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab_server\app.py", line 10, in <module>
from .handlers import LabConfig, add_handlers
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab_server\handlers.py", line 18, in <module>
from .listings_handler import ListingsHandler, fetch_listings
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab_server\listings_handler.py", line 8, in <module>
import requests
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\__init__.py", line 147, in <module>
from . import packages, utils
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\utils.py", line 24, in <module>
from . import certs
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\certs.py", line 14, in <module>
from certifi import where
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 177, in _exec_module
notify_module_loaded(module)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
return wrapped(*args, **kwargs)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
hook(module)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi_win32\wrapt_certifi.py", line 20, in apply_patches
certifi_win32.wincerts.CERTIFI_PEM = certifi.where()
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi\core.py", line 72, in where
_CACERT_PATH = str(_CACERT_CTX.__enter__())
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 135, in __enter__
return next(self.gen)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 98, in _tempfile
_os_remove(raw_path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\loque\\AppData\\Local\\Temp\\tmpfsz7k7d8'
How can I fix this?
I try Re-installing python and even installing other versions, not working still :(
I also deleted all the contents in the Temp folders and once i run the code it creates a new temp file that uses the process.
I can't install packages anymore.
Every time I try to run:
py -m pip install [name of the package]
I get:
Traceback (most recent call last):
File "C:\Users\Filippo Sebastio\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Filippo Sebastio\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Filippo Sebastio\Anaconda3\lib\site-packages\pip\__main__.py", line 19, in <module>
sys.exit(_main())
File "C:\Users\Filippo Sebastio\Anaconda3\lib\site-packages\pip\_internal\__init__.py", line 246, in main
return command.main(cmd_args)
File "C:\Users\Filippo Sebastio\Anaconda3\lib\site-packages\pip\_internal\basecommand.py", line 264, in main
timeout=min(5, options.timeout)) as session:
File "C:\Users\Filippo Sebastio\Anaconda3\lib\site-packages\pip\_internal\basecommand.py", line 81, in _build_session
insecure_hosts=options.trusted_hosts,
File "C:\Users\Filippo Sebastio\Anaconda3\lib\site-packages\pip\_internal\download.py", line 338, in __init__
self.headers["User-Agent"] = user_agent()
File "C:\Users\Filippo Sebastio\Anaconda3\lib\site-packages\pip\_internal\download.py", line 125, in user_agent
data["openssl_version"] = ssl.OPENSSL_VERSION
AttributeError: module 'ssl' has no attribute 'OPENSSL_VERSION'
I have no idea of what happened but I am afraid I deleted part of the ssl script (which I am not even sure how I opened!)
Under Ubuntu 16.04 and Python 2.7.12 sudo -H pip install pyublas fails with the following stacktrace:
Collecting pyublas
Using cached PyUblas-2013.1.tar.gz
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz
Extracting in /tmp/tmpnYhYMx
Now working in /tmp/tmpnYhYMx/distribute-0.6.35
Building a Distribute egg in /tmp/pip-build-vvsChR/pyublas
Traceback (most recent call last):
File "setup.py", line 248, in <module>
scripts = scripts,
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/tmp/tmpnYhYMx/distribute-0.6.35/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/tmp/tmpnYhYMx/distribute-0.6.35/setuptools/dist.py", line 257, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2027, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2237, in requires
dm = self._dep_map
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2466, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2499, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2496, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/tmp/tmpnYhYMx/distribute-0.6.35/_markerlib/markers.py", line 109, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'sys_platform' is not defined
/tmp/pip-build-vvsChR/pyublas/distribute-0.6.35-py2.7.egg
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-vvsChR/pyublas/setup.py", line 143, in <module>
main()
File "/tmp/pip-build-vvsChR/pyublas/setup.py", line 29, in main
from aksetup_helper import hack_distutils, get_config, setup, \
File "aksetup_helper.py", line 3, in <module>
distribute_setup.use_setuptools()
File "distribute_setup.py", line 152, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "distribute_setup.py", line 132, in _do_download
_build_egg(egg, tarball, to_dir)
File "distribute_setup.py", line 123, in _build_egg
raise IOError('Could not build the egg.')
IOError: Could not build the egg.
Following various related SO answers, I have confirmed that distribute is not installed, setuptools is up to date (setuptools (36.0.1)).
I have also tried manually running setup per this answer to no avail.