cannot create piepenv in linux ubuntu - pipenv

hello everyone…i have problem in launching venv using pipenv…i never had this problem in windows…I have recently migrated to linux Ubuntu…so i cannot solve this problem…I would be grateful if someone could help me
Creating a virtualenv for this project...
Pipfile: /media/sasan/F/my projects/Djprojects/newprj/Pipfile
Using /usr/bin/python3 (3.10.4) to create virtualenv...
⠸ Creating virtual environment...created virtual environment CPython3.10.4.final.0-64 in 106ms
creator CPython3Posix(dest=/home/sasan/.local/share/virtualenvs/newprj-cXkKfH7p, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/sasan/.local/share/virtualenv)
added seed packages: pip==22.2.2, setuptools==65.3.0, wheel==0.37.1
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
✔ Successfully created virtual environment!
Traceback (most recent call last):
File "/usr/bin/pipenv", line 33, in <module>
sys.exit(load_entry_point('pipenv==11.9.0', 'console_scripts', 'pipenv')())
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/cli/options.py", line 57, in main
return super().main(*args, **kwargs, windows_expand_args=False)
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/cli/command.py", line 397, in shell
do_shell(
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/core.py", line 2520, in do_shell
ensure_project(
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/core.py", line 525, in ensure_project
ensure_virtualenv(
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/core.py", line 458, in ensure_virtualenv
do_create_virtualenv(
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/core.py", line 959, in do_create_virtualenv
project._environment = Environment(
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/environment.py", line 79, in __init__
self._base_paths = self.get_paths()
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/environment.py", line 390, in get_paths
c = subprocess_run(command)
File "/home/sasan/.local/lib/python3.10/site-packages/pipenv/utils/processes.py", line 75, in subprocess_run
return subprocess.run(
File "/usr/lib/python3.10/subprocess.py", line 501, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.10/subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1842, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/sasan/.local/share/virtualenvs/newprj-cXkKfH7p/bin/python'

Related

Superset exporting and importing the Dashboards using CLI (for versioning control)

Goal: My goal is to export the all the dashboards from the superset so that I can save them as backup and also make sure that I can import them.
Existing setup: I am cloning superset from git and using docker-compose -f docker-compose-non-dev.yml up
to setup and run the superset (following this documentation)
Issue:
Using superset CLI: I am using this documentation
to connect to the existing docker image on which superset is running and then running superset export-dashboards but it throws the following error:
Loaded your LOCAL configuration at [/app/docker/pythonpath_dev/superset_config.py]
logging was configured successfully
2021-10-20 06:54:49,727:INFO:superset.utils.logging_configurator:logging was configured successfully
2021-10-20 06:54:49,732:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
/usr/local/lib/python3.8/site-packages/flask_caching/__init__.py:201: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
warnings.warn(
Starting export
2021-10-20 06:54:50,962:INFO:superset.utils.dashboard_import_export:Starting export
Traceback (most recent call last):
File "/usr/local/bin/superset", line 33, in <module>
sys.exit(load_entry_point('apache-superset', 'console_scripts', 'superset')())
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 426, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 426, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/app/superset/cli.py", line 413, in export_dashboards
data = dashboard_import_export.export_dashboards(db.session)
File "/app/superset/utils/dashboard_import_export.py", line 33, in export_dashboards
data = Dashboard.export_dashboards(dashboard_ids)
File "/app/superset/models/dashboard.py", line 385, in export_dashboards
json_metadata = json.loads(dashboard.json_metadata)
File "/usr/local/lib/python3.8/json/__init__.py", line 341, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
Kindly help me debug, I have also changed the "VERSIONED_EXPORT": True

ERROR: while installing Ipex using docker centos image

Unable to install Ipex using docker centos image
I pulled this docker image: docker pull sysstacks/dlrs-pytorch-centos
Tried to run on my linux machine with this command: docker run -it sysstacks/dlrs-pytorch-centos bash
I was trying to install Ipex using centos docker image (image name: sysstacks/dlrs-pytorch-centos) unfortunately i got this error.
after setting env
enter image description here
[root#0d96884d3a05 /]# python -m pip install torch_ipex==1.9.0 -f https://software.intel.com/ipex-whl-stable
Looking in links: https://software.intel.com/ipex-whl-stable
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 180, in _main
status = self.run(options, args)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 204, in wrapper
return func(self, options, args)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 319, in run
reqs, check_supported_wheels=not options.target_dir
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 128, in resolve
requirements, max_rounds=try_to_avoid_resolution_too_deep
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 473, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 341, in resolve
name, crit = self._merge_into_criterion(r, parent=None)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 172, in _merge_into_criterion
if not criterion.candidates:
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/resolvelib/structs.py", line 139, in __bool__
return bool(self._sequence)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in __bool__
return any(self)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 129, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 30, in _iter_built
for version, func in infos:
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 272, in iter_index_candidate_infos
hashes=hashes,
File "/usr/local/lib/python3.6/site-packages/pip/_internal/index/package_finder.py", line 879, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/index/package_finder.py", line 824, in find_all_candidates
page_candidates = list(page_candidates_it)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/index/sources.py", line 134, in page_candidates
yield from self._candidates_from_page(self._link)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/index/package_finder.py", line 783, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/index/collector.py", line 512, in fetch_page
return _get_html_page(location, session=self.session)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/index/collector.py", line 422, in _get_html_page
resp = _get_html_response(url, session=session)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/index/collector.py", line 137, in _get_html_response
"Cache-Control": "max-age=0",
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/network/session.py", line 449, in request
return super().request(method, url, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/cachecontrol/adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/connection.py", line 506, in _connect_tls_proxy
ssl_context=ssl_context,
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/util/ssl_.py", line 432, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/util/ssl_.py", line 474, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "/usr/lib64/python3.6/ssl.py", line 365, in wrap_socket
_context=self, _session=session)
File "/usr/lib64/python3.6/ssl.py", line 732, in __init__
raise ValueError("check_hostname requires server_hostname")
NOTE:
I have tried all these methods shown below but none of them worked
Why requests raise this exception "check_hostname requires server_hostname"?
I think the issue is with your proxy, can you please try below commands in your docker container:
export HTTP_PROXY=http://x.x.x.x
export https_proxy=http://x.x.x.x
export HTTPS_PROXY=http://x.x.x.x
export http_proxy=http://x.x.x.x
Change x with your proxy ip

Downloading language model in Spacy breaks in docker

So my docker file has the following line
RUN python -m spacy download en_core_web_sm
Which throws an error stating thinc module is not found.
So, I decided to add the following line above the previous line.
RUN pip install thinc
When I compile I get the following error.
Step 30/48 : RUN pip install thinc
---> Running in 7ba293263245
Collecting thinc
Downloading https://files.pythonhosted.org/packages/25/99/e21c2a1622c193b2c93a628496fea4525a0ce93e3b47f3cb06559b6ff3ee/thinc-7.4.3.tar.gz (1.3MB)
Complete output from command python setup.py egg_info:
BLIS_COMPILER? None
WARNING: pip versions <19.3 (currently installed: 9.0.1) are unable to detect binary wheel compatibility for blis. To avoid a source install with a very long compilation time, please upgrade pip with `pip install --upgrade pip`.
If you know what you're doing and you really want to compile blis from source, please set the environment variable BLIS_REALLY_COMPILE=1.
Traceback (most recent call last):
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 157, in save_modules
yield saved
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 248, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 278, in run
return func()
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 246, in runner
_execfile(setup_script, ns)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-v4oqr4r6/blis-0.7.3/setup.py", line 219, in <module>
"cython>=0.25",
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/app-root/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1101, in run_setup
run_setup(setup_script, args)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 251, in run_setup
raise
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 169, in save_modules
saved_exc.resume()
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 144, in resume
six.reraise(type, exc, self._tb)
File "/opt/app-root/lib/python3.6/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 157, in save_modules
yield saved
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 248, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 278, in run
return func()
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 246, in runner
_execfile(setup_script, ns)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-v4oqr4r6/blis-0.7.3/setup.py", line 219, in <module>
"cython>=0.25",
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-_lc_0t4n/thinc/setup.py", line 276, in <module>
setup_package()
File "/tmp/pip-build-_lc_0t4n/thinc/setup.py", line 272, in setup_package
cmdclass={"build_ext": build_ext_subclass},
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/dist.py", line 315, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/opt/app-root/lib/python3.6/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
replace_conflicting=True,
File "/opt/app-root/lib/python3.6/site-packages/pkg_resources/__init__.py", line 850, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/opt/app-root/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1122, in best_match
return self.obtain(req, installer)
File "/opt/app-root/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1134, in obtain
return installer(requirement)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/dist.py", line 429, in fetch_build_egg
return cmd.easy_install(req)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 665, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 695, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 876, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1115, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/opt/app-root/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1103, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_lc_0t4n/thinc/
You are using pip version 9.0.1, however version 20.2.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The image is
FROM centos/python-36-centos7
before you install python packages add the following line
RUN pip install --upgrade pip

docker-compose command is giving error while building

I am pretty amateur to docker. I was running my application on docker successfully from many days.
Now when I run the command docker-compose up -d it gives me the error as below
raceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 88, in main
File "compose/cli/main.py", line 140, in perform_command
File "compose/cli/main.py", line 900, in up
File "compose/project.py", line 385, in up
File "compose/project.py", line 590, in warn_for_swarm_mode
File "site-packages/docker/api/daemon.py", line 73, in info
File "site-packages/docker/utils/decorators.py", line 47, in inner
File "site-packages/docker/api/client.py", line 179, in _get
File "site-packages/requests/sessions.py", line 488, in get
File "site-packages/requests/sessions.py", line 466, in request
File "site-packages/requests/sessions.py", line 641, in
merge_environment_settings
File "site-packages/requests/utils.py", line 605, in get_environ_proxies
File "site-packages/requests/utils.py", line 589, in should_bypass_proxies
File "urllib.py", line 1510, in proxy_bypass
File "urllib.py", line 1484, in proxy_bypass_macosx_sysconf
ValueError: negative shift count
Failed to execute script docker-compose
I searched this error ValueError: negative shift count a lot but nothing useful found.

Build gerrit events-log plugin

I am trying to build gerrit events-log plugin via Buck build, but its failing with error:
root#monkey:/tmp/events-log# buck build plugin
[-] PROCESSING BUCK FILES...FINISHED 0.3s [100%]
[+] DOWNLOADING... (0.00 B/S, TOTAL: 0.00 B, 0 Artifacts)
[+] BUILDING...0.2s [19%] (3/19 JOBS, 0 UPDATED, 0.0% CACHE MISS)
|=> //lib/commons:dbcp__download_bin... 0.1s (running genrule[0.0s])
Traceback (most recent call last):
File ".bootstrap/_pex/pex.py", line 320, in execute
File ".bootstrap/_pex/pex.py", line 253, in _wrap_coverage
File ".bootstrap/_pex/pex.py", line 285, in _wrap_profiling
File ".bootstrap/_pex/pex.py", line 363, in _execute
File ".bootstrap/_pex/pex.py", line 421, in execute_entry
File ".bootstrap/_pex/pex.py", line 426, in execute_module
File "/usr/lib/python2.7/runpy.py", line 180, in run_module
fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "bucklets/tools/download_file.py", line 198, in <module>
File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Can somebody please tell how to fix it?
Thanks
If you haven't already figured this out, ensure that 'zip' is installed and in your $PATH.
github issue for similar failure in a different plugin

Resources