EnvironmentError when pip installing ipython - path

I keep getting this error when trying to pip install ipython on my Windows. pip worked for pandas and other libs.
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\Me\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\jedi\\third_party\\typeshed\\third_party\\2and3\\requests\\packages\\urllib3\\packages\\ssl_match_hostname\\_implementation.pyi'
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\commands\install.py", line 407, in run
use_user_site=options.use_user_site,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\req\__init__.py", line 58, in install_given_reqs
**kwargs
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\req\req_install.py", line 928, in install
use_user_site=use_user_site, pycompile=pycompile,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\req\req_install.py", line 461, in move_wheel_files
warn_script_location=warn_script_location,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\wheel.py", line 432, in move_wheel_files
clobber(source, lib_dir, True)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\wheel.py", line 410, in clobber
shutil.copyfile(srcfile, destfile)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\My User\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\jedi\\third_party\\typeshed\\third_party\\2and3\\requests\\packages\\urllib3\\packages\\ssl_match_hostname\\_implementation.pyi'```

I had similar issue. I changed the registry key "Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled" to 1.

I had the same problem. For me it was, that the file path was too long. Rename things (for example the PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0 stuff) to shorten the path.

The Windows Python installer allows you to change the maximum path length at install or upgrade and this will fix the problem. You can also lookup change maximum path length Win 10 to find out how to change the registry.

Related

Ros2 not finding executables running in Docker

I'm trying to run a python script with ros2 in my docker container, and everything up to running the Script works, I can even run Gazebo via a launch file, and it works.
The Error ROS gives me is the following:
root#86d8bf3a6eb9:/# ros2 run field_robot robot_spawner.py
Traceback (most recent call last):
File "/opt/ros/foxy/bin/ros2", line 11, in <module>
load_entry_point('ros2cli==0.9.11', 'console_scripts', 'ros2')()
File "/opt/ros/foxy/lib/python3.8/site-packages/ros2cli/cli.py", line 67, in main
rc = extension.main(parser=parser, args=args)
File "/opt/ros/foxy/lib/python3.8/site-packages/ros2run/command/run.py", line 70, in main
return run_executable(path=path, argv=args.argv, prefix=prefix)
File "/opt/ros/foxy/lib/python3.8/site-packages/ros2run/api/__init__.py", line 61, in run_executable
process = subprocess.Popen(cmd)
File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/field_robot/dev_ws/install/field_robot/lib/field_robot/robot_spawner.py'
And yes, I checked, the File actually exists:
root#86d8bf3a6eb9:/# ls -l /field_robot/dev_ws/install/field_robot/lib/field_robot/robot_spawner.py
-rwxr-xr-x 1 root root 1964 Apr 12 14:37 /field_robot/dev_ws/install/field_robot/lib/field_robot/robot_spawner.py
Also, I'm running the Host system on Windows, so it could be that something with windows is fucked up, so if you have an Idea what could be the Problem there, that also might be it
Based on the comments it appears you're running into this issue because of the file type. If they're being edited in Windows first it is likely they are DOS files and not UNIX files. I know this causes issues with ROS1 so I assume it's the case in ROS2 as well. To fix this, you have a couple of options.
Usually the easiest would be to use dos2unix. This isn't installed by default but you can get it via apt install dos2unix assuming your image is Ubuntu. The files can be converted by running dos2unix <filename> inside your container.

Using dc-app-performance-toolkit with Taurus on windows

I am trying to use https://github.com/atlassian/dc-app-performance-toolkit on windows 10
I have installed taurus from https://gettaurus.org/install/Installation/
jira is installed on my system and i can access it using http://localhost:2990/jira
However when i run bzt jira.yml i am getting below error.
14:43:35 INFO: Starting shell command: python util/post_run/jmeter_post_check.py←[0m
14:43:36 INFO: Starting shell command: python util/jtl_convertor/jtls-to-csv.py kpi.jtl selenium.jtl←[0m
←[33m14:43:36 WARNING: Errors for python util/jtl_convertor/jtls-to-csv.py kpi.jtl selenium.jtl:
Traceback (most recent call last):
File "util/jtl_convertor/jtls-to-csv.py", line 8, in <module>
import pandas
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\__init__.py", line 11, in <module>
__import__(dependency)
File "C:\Program Files\Taurus\pkgs\numpy\__init__.py", line 138, in <module>
from . import _distributor_init
File "C:\Program Files\Taurus\pkgs\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\ctypes\__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
←[0m
←[31m14:43:36 ERROR: Child Process Error: Test runner selenium (PyTestExecutor) has failed with retcode 1←[0m
←[31m14:43:36 ERROR: PyTestExecutor STDERR:
Traceback (most recent call last):
File "C:\Program Files\Taurus\pkgs\bzt\resources\pytest_runner.py", line 22, in <module>
import pytest
File "C:\Program Files\Taurus\pkgs\pytest\__init__.py", line 7, in <module>
from _pytest.assertion import register_assert_rewrite
File "C:\Program Files\Taurus\pkgs\_pytest\assertion\__init__.py", line 10, in <module>
from _pytest.assertion import rewrite
File "C:\Program Files\Taurus\pkgs\_pytest\assertion\rewrite.py", line 30, in <module>
from _pytest.assertion import util
File "C:\Program Files\Taurus\pkgs\_pytest\assertion\util.py", line 14, in <module>
import _pytest._code
File "C:\Program Files\Taurus\pkgs\_pytest\_code\__init__.py", line 2, in <module>
from .code import Code
File "C:\Program Files\Taurus\pkgs\_pytest\_code\code.py", line 29, in <module>
import pluggy
File "C:\Program Files\Taurus\pkgs\pluggy\__init__.py", line 16, in <module>
from .manager import PluginManager, PluginValidationError
File "C:\Program Files\Taurus\pkgs\pluggy\manager.py", line 11, in <module>
import importlib_metadata
File "C:\Program Files\Taurus\pkgs\importlib_metadata\__init__.py", line 623, in <module>
__version__ = version(__name__)
File "C:\Program Files\Taurus\pkgs\importlib_metadata\__init__.py", line 585, in version
return distribution(distribution_name).version
File "C:\Program Files\Taurus\pkgs\importlib_metadata\__init__.py", line 558, in distribution
return Distribution.from_name(distribution_name)
File "C:\Program Files\Taurus\pkgs\importlib_metadata\__init__.py", line 215, in from_name
raise PackageNotFoundError(name)
importlib_metadata.PackageNotFoundError: No package metadata was found for importlib_metadata←[0m
What am i doing wrong?
The error you're getting is about missing importlib-metadata package, you need to have all the packages listed under requirements.txt installed in order to be able to run these tests, it seems like you omitted Installation and set up chapter
So make sure to execute pip install -r requirements.txt prior to launching the Taurus test as Taurus doesn't take care of dependencies on its own.
More information:
Installing Python Package Dependencies
Navigating your First Steps Using Taurus
I had to remove python installed at
C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\
which was installed prior to bzt
To correct this, I have uninstalled taurus and installed it manually.
Installed python using python-3.8.5-amd64.exe. and not using python-3.8.5.exe

cannot install virtual python environment

I am trying to install and use opencv with Python 3 via Homebrew in macOS Sierra. I followed the steps from this tutorial, but after typing the command pip install virtualenv virtualenvwrapper I get the exception shown below.
When I first tried to install the virtual environment it said it couldn’t find pip. I used sudo easy_install pip and typed again the required command-line.
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py'
but after using pip install --user virtualenv virtualenvwrapper it went fine. but after updating the source as given here and source it I get the following -bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
even after I close the terminal and reopen it in the second line, I see
-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
please help me :(
This is a permission issue. As outlined here, you should use the --user option:
pip install --user virtualenv virtualenvwrapper

OPEN CV iOS installation

I am installing the opencv in my system followings the command given by open cv http://docs.opencv.org/2.4/doc/tutorials/introduction/ios_install/ios_install.html
I am getting this error Please let me know what I am missing.
anil-Mac-2s-Mac-mini:opencv pws-mac-2$ python platforms/ios/build_framework.py ios
Executing: ['cmake', '-GXcode', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_TOOLCHAIN_FILE=/Users/pws-mac-2/Desktop/opencv/platforms/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake', '-DCMAKE_INSTALL_PREFIX=install', '-DENABLE_NEON=ON', '/Users/pws-mac-2/Desktop/opencv', '-DCMAKE_C_FLAGS=-fembed-bitcode', '-DCMAKE_CXX_FLAGS=-fembed-bitcode'] in /Users/pws-mac-2/Desktop/opencv/ios/build/armv7-iPhoneOS
============================================================
ERROR: [Errno 2] No such file or directory
============================================================
Traceback (most recent call last):
File "platforms/ios/build_framework.py", line 183, in <module>
b.build(args.out)
File "platforms/ios/build_framework.py", line 87, in build
self.buildOne(t[0], t[1], mainBD, cmake_flags)
File "platforms/ios/build_framework.py", line 105, in buildOne
execute(cmakecmd, cwd = builddir)
File "platforms/ios/build_framework.py", line 34, in execute
retcode = check_call(cmd, cwd = cwd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 535, in check_call
retcode = call(*popenargs, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
I am getting this error Please let me know how to resolve . . .
This error happens because cmake is either (a) not installed or (b) not on the user's path.
In this case, the OP had downloaded the cmake gui application from cmake.org, and copied it to /Applications. This app doesn't add the path to the binaries automatically, which is why the script couldn't find cmake.
By adding the path to the cmake binaries (bash syntax):
PATH=$PATH:/Applications/CMake.app/Contents/bin
the OP was able to successfully build opencv.
Most package managers - e.g. homebrew or macports whould have automatically added a path to the user's profile that would have permitted it to run without having to modify the path any more.
You may need to install CMake
My-Mac: opencv$ brew install cmake

ponydebugger error when installing

I got some error message after the command :
curl -sk https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | \
python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
this is my termial tell me,
Overwriting /Users/hokila/Library/PonyDebugger/lib/python2.7/orig-prefix.txt with new content
New python executable in /Users/hokila/Library/PonyDebugger/bin/python
Traceback (most recent call last):
File "<stdin>", line 2462, in <module>
File "<stdin>", line 944, in main
File "<stdin>", line 1045, in create_environment
File "<stdin>", line 1361, in install_python
File "<stdin>", line 435, in copyfile
File "<stdin>", line 412, in copyfileordir
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 128, in copy2
copyfile(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 2] No such file or directory: '/Users/hokila/Library/PonyDebugger/.Python'
It seems the python version error,so I update my python to 2.7.3.
then I still got the same error.How could I solve this?
This problem also occured to me and I was almost desperate. I reinstalled Python 2.7.2 and it worked fine.
I tried to solve this problem manually before using the instructions in README_ponyd.rst and I was also partially successful:
Development installation ````````````````````````
If you already have PonyDebugger git repo checked out you can can set
up a virtualenv manually and have your ponyd installation point to
your existing checkout. For demonstration we assume $VENV is set
to your intended install path and $PONYDEBUGGER_PATH is set to
your PonyDebugger git checkout::
# if you don't already have virtualenv installed
sudo easy_install
virtualenv
virtualenv "$VENV"
source "$VENV/bin/activate"
pip install -e "$PONYDEBUGGER_PATH"
# to ensure your shell knows ponyd exists hash -r
To run this ponyd you can either activate your environment by source
"$VENV/bin/activate" and ponyd will be added to your path. You
can also just call it directly via $VENV/bin/ponyd without
activating first.
You should install virtualenv before. You can try combination of both steps. Hope it helps...

Resources