Just got python, pip and virtualenv installed on my windows 7 box.
Ran into the following issues when I want to create a virtual enviroment:
virtualenv test gives me:
------------------------------------------------------------
-c run on 09/18/14 00:24:25
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking setuptools
Cleaning up...
Removing temporary dir C:\Users\Han\test\build...
Exception:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.whl\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "c:\python27\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.whl\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "c:\python27\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.whl\pip\req.py", line 1177, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "c:\python27\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.whl\pip\index.py", line 209, in find_requirement
file_locations, url_locations = self._sort_locations(locations)
File "c:\python27\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.whl\pip\index.py", line 128, in _sort_locations
sort_path(os.path.join(path, item))
File "c:\python27\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.whl\pip\index.py", line 109, in sort_path
if mimetypes.guess_type(url, strict=False)[0] == 'text/html':
File "c:\python27\Lib\mimetypes.py", line 287, in guess_type
init()
File "c:\python27\Lib\mimetypes.py", line 348, in init
db.read_windows_registry()
File "c:\python27\Lib\mimetypes.py", line 256, in read_windows_registry
with _winreg.OpenKey(hkcr, subkeyname) as subkey:
WindowsError: [Error 2] The system cannot find the file specified
any ideas? Have tried using the registry checker as well as hard coding the mimetypes.py file: http://www.swarley.me.uk/blog/2014/04/23/python-pip-and-windows-registry-corruption/ but the same error still occurs.
You're getting a different specific error message from the read_windows_registry() function than the one I talked about in my blog post, so I don't think deleting/skipping corrupted registry keys containing null characters is going to work for you.
I just found issue #505 in the virtualenv project which seems to be talking about your specific problem. There are several recommendations in that thread - do any of those solve your problem? It looks like the problem was subsequently fixed by pull request #579 anyway, so perhaps you just need to update to a newer version of virtualenv?
Related
I am new to python, and its ecosystem, so I am having trouble figuring out how to fix an error I am getting while trying to install a library for a project. I understand it has something to due with the fact that my computer has two hard drives, but I do not know how to fix it. (I know putting the project on the other drive probably would, but that drive is too small, and only really has my operating system.)
This is the traceback of the error:
Traceback (most recent call last):
File "D:\(name)\(project)\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\cli\base_command.py", line 179, in main
status = self.run(options, args)
File "D:\(name)\(project)\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\commands\install.py", line 384, in run
installed = install_given_reqs(
File "D:\(name)\(project)\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\req\__init__.py", line 53, in install_given_reqs
requirement.install(
File "D:\(name)\(project)\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\req\req_install.py", line 910, in install
self.move_wheel_files(
File "D:\(name)\(project)\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\req\req_install.py", line 437, in move_wheel_files
move_wheel_files(
File "D:\(name)\(project)\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\wheel.py", line 458, in move_wheel_files
clobber(source, dest, False, fixer=fixer, filter=filter)
File "D:\(name)\(project)\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\wheel.py", line 424, in clobber
record_installed(srcfile, destfile, changed)
File "D:\(name)\(project)\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\wheel.py", line 351, in record_installed
newpath = normpath(destfile, lib_dir)
File "D:\(name)\(project)\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\wheel.py", line 68, in normpath
return os.path.relpath(src, p).replace(os.path.sep, '/')
File "C:\Users\(name)\AppData\Local\Programs\Python\Python38\lib\ntpath.py", line 703, in relpath
raise ValueError("path is on mount %r, start on mount %r" % (
ValueError: path is on mount 'D:', start on mount 'C:'
Also, further information, though I don't think it is relevant(but just in case), I am installing this package in PyCharm, which itself runs the pip command.
I am trying to install google cloud SDK using install.bat. I have tried downloading the bundled pythons versions 275 and current version 276, they both fail at the same spot. It is able to find python in the platform/bundledpython folder so that is not the issue. I have also tried the suggestions online including making sure that the "Find" command works on a command prompt. Any help appreciated.
The latest available version is: 276.0.0
���───────────────────────────────────────────────────────────────────────────────────────────────────────────────┐Trac
back (most recent call last):
File "C:\google-cloud-sdk\google-cloud-sdk\\bin\bootstrapping\install.py", line 225, in <module>
main()
File "C:\google-cloud-sdk\google-cloud-sdk\\bin\bootstrapping\install.py", line 203, in main
Install(pargs.override_components, pargs.additional_components)
File "C:\google-cloud-sdk\google-cloud-sdk\\bin\bootstrapping\install.py", line 148, in Install
_CLI.Execute(['--quiet', 'components', 'list'])
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\calliope\cli.py", line 1007, in Execute
self._HandleAllErrors(exc, command_path_string, specified_arg_names)
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\calliope\cli.py", line 1040, in _HandleAllErrors
exceptions.HandleError(exc, command_path_string, self.__known_error_handler)
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\calliope\exceptions.py", line 527, in HandleError
core_exceptions.reraise(exc)
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\core\exceptions.py", line 146, in reraise
six.reraise(type(exc_value), exc_value, tb)
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\calliope\cli.py", line 981, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\calliope\backend.py", line 809, in Run
display_info=self.ai.display_info).Display()
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\calliope\display.py", line 483, in Display
self._printer.Print(self._resources)
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\core\resource\resource_printer_base.py", line 279, in P
int
self.Finish()
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\core\resource\table_printer.py", line 467, in Finish
self._out.write(line)
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\core\log.py", line 239, in write
self._Write(plain_text, styled_text)
File "C:\google-cloud-sdk\google-cloud-sdk\lib\googlecloudsdk\core\log.py", line 232, in _Write
self.__stream_wrapper.stream.write(stream_msg)
I just had the same problem trying to install the latest Google Cloud SDK (276.0.0). The Windows setup was stuck on "Installing components".
Looking at the process list with Process Explorer I could see it was running this command that was stuck, as you probably did to get your stack trace. I took the command line and ran it in a separate Administror cmd.exe (paths might differ per system, the idea is the same).
cd "C:\Program Files (x86)\Google\Cloud SDK"
SET "CLOUDSDK_CORE_DISABLE_PROMPTS=1"
SET "CLOUDSDK_CONFIG=%APPDATA%\gcloud"
"C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\install.bat" --quiet --disable-installation-options --path-update "FALSE" --usage-reporting "true" --additional-components beta powershell"
Running them would produce the same error / stack trace.
Editing log.py and commenting out (prefix with #) line 232 would make it get further, but it runs into a separate problem:
ERROR: Cannot use bundled Python installation to update Cloud SDK in non-interactive mode.
Please run again in interactive mode.
Enable prompts with CLOUDSDK_CORE_DISABLE_PROMPTS envvar and remove --quiet and --disable-installation-options from the install.bat command line and run it again.
SET "CLOUDSDK_CORE_DISABLE_PROMPTS=0"
"C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\install.bat" --path-update "FALSE" --usage-reporting "true" --additional-components beta powershell"
This time it should continue, start a new console where it actually installs the components and eventually finish succesfully.
This is the error I get in VSCode when running docker-compose.
PS D:\Work\Imho\Api> docker-compose -f docker-compose.yml up
Creating network "api_default" with the default driver
Pulling ignite (apacheignite/ignite:latest)...
latest: Pulling from apacheignite/ignite
5040bd298390: Pulling fs layer
fce5728aad85: Pulling fs layer
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose\cli\main.py", line 68, in main
File "compose\cli\main.py", line 118, in perform_command
File "compose\cli\main.py", line 926, in up
File "compose\project.py", line 401, in up
File "compose\service.py", line 305, in ensure_image_exists
File "compose\service.py", line 1001, in pull
File "compose\progress_stream.py", line 37, in stream_output
File "codecs.py", line 370, in write
File "site-packages\colorama\ansitowin32.py", line 40, in write
File "site-packages\colorama\ansitowin32.py", line 141, in write
File "site-packages\colorama\ansitowin32.py", line 169, in write_and_convert
File "site-packages\colorama\ansitowin32.py", line 174, in write_plain_text
IOError: [Errno 0] Error
Failed to execute script docker-compose
docker-compose.yml:
version: '3'
services:
ignite:
image: apacheignite/ignite
This error only happens on one of my 3 machines, so I have no idea what causes it. Resetting to factory defaults or reinstalling docker and vscode doesn't help. Without docker compose the image is pulling and then working fine. All the machines are on windows 10 and latest stable docker installed.
Here is the issue I opened on github. It appeared that this behavior only occurs in VSCode powershell console, but not in regular powershell console. The solution with changing encoding suggested there didn't help.
Solution: Update to 1803 on Windows 10. If you can't update, use external command prompt.
The same thing happens to me with Python scripts. Apparently, this is a Windows Update issue:
https://github.com/Microsoft/vscode/issues/36630#issuecomment-359969098
Edit: My workaround due to my company restricting updates is to use external terminal in VS Code
I'm developing a web-browser extension, and have found a tool which will allow me to publish the extension for all browsers from a single code-base. The tool is called Open Forge and is developed by Trigger.io.
The setup instructions listed in the Open Forge ReadMe (included in the link above) involve creating and configuring a new python environment. I've been able to create and activate a new python environment in my project directory, however the command to configure the environment (pip install -r requirements.txt) generates the following exception:
Exception:
Traceback (most recent call last):
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\commands\install.py", line 347, in run
root=options.root_path,
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\req\req_set.py", line 497, in install
and req.installed_version in distribute_req):
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\pkg_resources.py", line 2851, in __contains__
return self.specifier.contains(item, prereleases=True)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\packaging\specifiers.py", line 651, in contains
item = parse(item)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\packaging\version.py", line 41, in parse
return Version(version)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\packaging\version.py", line 202, in __init__
match = self._regex.search(version)
TypeError: expected string or buffer
The process hangs on line 17 of the requirements.txt document. The line in question is:
PyHamcrest==1.6
I have also attempted this process on Unix (OS X) and encountered the same error.
I'm able to complete the process successfully by specifying the latest version of PyHamcrest (1.8) in requirements.txt. I've never used PyHamcrest before, and don't feel comfortable speculating as to why 1.8 works while 1.6 does not.
I was following the documentation of pgs4a, where in the build part I got a WindowsError [Error 2].
The Command and Traceback:
C:\Users\karuna\Desktop\Jython\Python\pgs4a-0.9.4>android.py build "C:\Users\karuna\Desktop\Jython\P
ython\pgs4a-0.9.4\mygame" release install
Updating build files.
Traceback (most recent call last):
File "C:\Users\karuna\Desktop\Jython\Python\pgs4a-0.9.4\android.py", line 66, in <module>
main()
File "C:\Users\karuna\Desktop\Jython\Python\pgs4a-0.9.4\android.py", line 54, in main
build.build(iface, args.argument[0], args.argument[1:])
File "buildlib\build.py", line 301, in build
build_core(iface, directory, commands)
File "buildlib\build.py", line 221, in build_core
subprocess.call([plat.android, "update", "project", "-p", '.', '-t', 'android-8', '-n', versione
d_name])
File "C:\Python2.7 For Chintoo\lib\subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python2.7 For Chintoo\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python2.7 For Chintoo\lib\subprocess.py", line 893, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
As obvious,
I am using Windows 7, and have:
Python 2.7.3
JDK
Android Emulator
Device drivers for my Sony Tipo.
Please help!
By the way,
I would prefer to get this running on my phone first. I am thinking of moving to the emulator later(after the tutorial is completed).
Is this question more suitable for https://android.stackexchange.com/?
I am not sure if this is still an issue for you, but I ran into the similar issue recently and managed to solve it so I will just leave a note here.
If anyone gets this kind of error, go to pgs4a folder and android-sdk folder. There, run SDK Manager.exe file. You will see a list of Tools and different android versions. Try to find the version that you are working on and install everything that is 'uninstalled'.
I managed to solve the above issue by installing everything under my current AND previous Android versions. Hope this will help anyone who ran into the same issue!
rename the folder android-sdk-windows to android-sdk