gcloud Object metadata supplied for destination object had no object name - gcloud

I try to rsync a local folder with a google cloud bucket. However, I get the following exception from gcloud:
ArgumentException: Object metadata supplied for destination object had no object name.
Does anybody now a workaround for this?
StackTrace:
018-04-15T08:30:06.3806055Z - [2 files][ 9.0 MiB/ 16.3 MiB] 69.2 KiB/s
2018-04-15T08:30:06.3806130Z DEBUG: Exception stack trace:
2018-04-15T08:30:06.3806196Z Traceback (most recent call last):
2018-04-15T08:30:06.3806287Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\__main__.py", line 571, in _RunNamedCommandAndHandleExceptions
2018-04-15T08:30:06.3806398Z user_project=user_project)
2018-04-15T08:30:06.3806489Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\command_runner.py", line 319, in RunNamedCommand
2018-04-15T08:30:06.3806582Z return_code = command_inst.RunCommand()
2018-04-15T08:30:06.3806672Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\commands\rsync.py", line 1462, in RunCommand
2018-04-15T08:30:06.3806763Z fail_on_error=True, seek_ahead_iterator=seek_ahead_iterator)
2018-04-15T08:30:06.3807079Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\command.py", line 1383, in Apply
2018-04-15T08:30:06.3807172Z arg_checker, should_return_results, fail_on_error)
2018-04-15T08:30:06.3807263Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\command.py", line 1454, in _SequentialApply
2018-04-15T08:30:06.3807353Z worker_thread.PerformTask(task, self)
2018-04-15T08:30:06.3807449Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\command.py", line 2120, in PerformTask
2018-04-15T08:30:06.3807540Z results = task.func(cls, task.args, thread_state=self.thread_gsutil_api)
2018-04-15T08:30:06.3807636Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\commands\rsync.py", line 1252, in _RsyncFunc
2018-04-15T08:30:06.3807736Z gzip_exts=cls.gzip_exts, preserve_posix=cls.preserve_posix_attrs)
2018-04-15T08:30:06.3807835Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 3515, in PerformCopy
2018-04-15T08:30:06.3807922Z allow_splitting=allow_splitting, gzip_encoded=gzip_encoded)
2018-04-15T08:30:06.3808025Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 2021, in _UploadFileToObject
2018-04-15T08:30:06.3808115Z parallel_composite_upload, logger)
2018-04-15T08:30:06.3808208Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 1872, in _DelegateUploadFileToObject
2018-04-15T08:30:06.3808308Z elapsed_time, uploaded_object = upload_delegate()
2018-04-15T08:30:06.3808401Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 2004, in CallNonResumableUpload
2018-04-15T08:30:06.3808489Z gzip_encoded=gzip_encoded_file)
2018-04-15T08:30:06.3808591Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 1583, in _UploadFileToObjectNonResumable
2018-04-15T08:30:06.3808684Z fields=UPLOAD_RETURN_FIELDS, gzip_encoded=gzip_encoded)
2018-04-15T08:30:06.3808778Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\cloud_api_delegator.py", line 287, in UploadObject
2018-04-15T08:30:06.3808970Z gzip_encoded=gzip_encoded)
2018-04-15T08:30:06.3809064Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\gcs_json_api.py", line 1376, in UploadObject
2018-04-15T08:30:06.3809148Z gzip_encoded=gzip_encoded)
2018-04-15T08:30:06.3809245Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\gcs_json_api.py", line 1152, in _UploadObject
2018-04-15T08:30:06.3809332Z ValidateDstObjectMetadata(object_metadata)
2018-04-15T08:30:06.3809425Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\cloud_api_helper.py", line 40, in ValidateDstObjectMetadata
2018-04-15T08:30:06.3809534Z 'Object metadata supplied for destination object had no object name.')
2018-04-15T08:30:06.3809621Z ArgumentException: ArgumentException: Object metadata supplied for destination object had no object name.
2018-04-15T08:30:06.3809696Z
2018-04-15T08:30:06.3809769Z ArgumentException: Object metadata supplied for destination object had no object name.
Used version on Windows:
Google Cloud SDK 197.0.0
bq 2.0.31
core 2018.04.06
gsutil 4.30

The above error, and per our discussion at this issue tracker report, is specific to using gsutil tool on Windows, and due to using forward-slash ./ rather than using backslash .\ in both command line and Powershell. It could be related to the fact that Windows MS-DOS uses backslashes to separate directories in file paths C:\someDirectory\anotherDirectory, and not forward-slashes like other operating systems. Hence, the following command should work:
$gsutil rsync -d .\ gs://bucketname/folder

Related

Get fatal error: server could not be contacted when running pgAdmin4. 'NoneType' object has no attribute 'value'

I have a fresh install of windows where I am trying to install Postgres and pgAdmin4.
I did a fresh install of everything (pgAdmin 4, postrgres 13, etc.) with default settings. When I run pgAdmin 4 I get a "fatal error: server could not be contacted" with the following message:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\username\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\config.py"
Webapp Path: "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py"
Environment:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\username\AppData\Roaming
- CHROME_CRASHPAD_PIPE_NAME: \\.\pipe\crashpad_4296_YJZESWNMDVNGRRUO
- CHROME_RESTART: NW.js|Whoa! NW.js has crashed. Relaunch now?|LEFT_TO_RIGHT
- CommonProgramFiles: C:\Program Files\Common Files
- CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
- CommonProgramW6432: C:\Program Files\Common Files
- COMPUTERNAME: pcname
- ComSpec: C:\Windows\system32\cmd.exe
- configsetroot: C:\Windows\ConfigSetRoot
- DriverData: C:\Windows\System32\Drivers\DriverData
- HOMEDRIVE: C:
- HOMEPATH: \Users\username
- LOCALAPPDATA: C:\Users\username\AppData\Local
- LOGONSERVER: \\pcname
- NUMBER_OF_PROCESSORS: 8
- NVM_HOME: C:\Users\username\AppData\Roaming\nvm
- NVM_SYMLINK: C:\Program Files\nodejs
- OneDrive: C:\Users\username\OneDrive
- OS: Windows_NT
- Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\PostgreSQL\12\bin;C:\Users\username\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\username\AppData\Local\Microsoft\WindowsApps;C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
- PGADMIN_INT_KEY: 2e023387-9c82-4cdd-af2f-c82562c6e4fc
- PGADMIN_INT_PORT: 50567
- PGADMIN_SERVER_MODE: OFF
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: 8c01
- ProgramData: C:\ProgramData
- ProgramFiles: C:\Program Files
- ProgramFiles(x86): C:\Program Files (x86)
- ProgramW6432: C:\Program Files
- PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
- PUBLIC: C:\Users\Public
- SystemDrive: C:
- SystemRoot: C:\Windows
- TEMP: C:\Users\username\AppData\Local\Temp
- TMP: C:\Users\username\AppData\Local\Temp
- USERDOMAIN: pcname
- USERDOMAIN_ROAMINGPROFILE: pcname
- USERNAME: username
- USERPROFILE: C:\Users\username
- windir: C:\Windows
--------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py", line 98, in <module>
app = create_app()
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\__init__.py", line 347, in create_app
if not os.path.exists(SQLITE_PATH) or get_version() == -1:
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\db_version.py", line 19, in get_version
return version.value
AttributeError: 'NoneType' object has no attribute 'value'
Note: 'username' and 'pcname' are placeholders that I substituted for the actual strings, some of which were originally capitalized.
Verified service "postgresql-x64-13" was running. I continue to get this message despite trying the following:
Running as administrator.
Deleting
C:\Users\username\AppData\Roaming\pgadmin.
Adding C:\Program Files\PostgreSQL\13\bin to the PATH environment variable (system and
user)
Restarting the service.
Uninstalling/reinstalling Postgres 13.
Uninstalling/installing Postgres 12.
Restarting my machine.
The one thing that yielded different results was stopping the service, deleting C:\Users\username\AppData\Roaming\pgadmin, restarting the service, then running pg4admin which resulted in a "fatal error" with the following output:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\username\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\config.py"
Webapp Path: "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py"
Environment:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\username\AppData\Roaming
- CHROME_CRASHPAD_PIPE_NAME: \\.\pipe\crashpad_10312_CHCJAQAYYFQQIAGB
- CHROME_RESTART: NW.js|Whoa! NW.js has crashed. Relaunch now?|LEFT_TO_RIGHT
- CommonProgramFiles: C:\Program Files\Common Files
- CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
- CommonProgramW6432: C:\Program Files\Common Files
- COMPUTERNAME: pcname
- ComSpec: C:\Windows\system32\cmd.exe
- configsetroot: C:\Windows\ConfigSetRoot
- DriverData: C:\Windows\System32\Drivers\DriverData
- HOMEDRIVE: C:
- HOMEPATH: \Users\username
- LOCALAPPDATA: C:\Users\username\AppData\Local
- LOGONSERVER: \\pcname
- NUMBER_OF_PROCESSORS: 8
- NVM_HOME: C:\Users\username\AppData\Roaming\nvm
- NVM_SYMLINK: C:\Program Files\nodejs
- OneDrive: C:\Users\username\OneDrive
- OS: Windows_NT
- Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\PostgreSQL\13\bin;C:\Users\username\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\username\AppData\Local\Microsoft\WindowsApps;C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\username\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\PostgreSQL\13\bin;
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
- PGADMIN_INT_KEY: cb6cf8e1-ca8b-416b-985f-1fd1a945ff06
- PGADMIN_INT_PORT: 50906
- PGADMIN_SERVER_MODE: OFF
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: 8c01
- ProgramData: C:\ProgramData
- ProgramFiles: C:\Program Files
- ProgramFiles(x86): C:\Program Files (x86)
- ProgramW6432: C:\Program Files
- PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
- PUBLIC: C:\Users\Public
- SESSIONNAME: Console
- SystemDrive: C:
- SystemRoot: C:\Windows
- TEMP: C:\Users\username\AppData\Local\Temp
- TMP: C:\Users\username\AppData\Local\Temp
- USERDOMAIN: pcname
- USERDOMAIN_ROAMINGPROFILE: pcname
- USERNAME: username
- USERPROFILE: C:\Users\username
- windir: C:\Windows
--------------------------------------------------------
NOTE: Configuring authentication for DESKTOP mode.
Traceback (most recent call last):
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py", line 91, in <module>
exec(open(file_quote(setup_py), 'r').read())
File "<string>", line 506, in <module>
File "<string>", line 378, in setup_db
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\__init__.py", line 351, in create_app
db_upgrade(app)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\db_upgrade.py", line 25, in db_upgrade
flask_migrate.upgrade(migration_folder)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py", line 96, in wrapped
f(*args, **kwargs)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py", line 271, in upgrade
command.upgrade(config, revision, sql=sql, tag=tag)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\command.py", line 294, in upgrade
script.run_env()
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\script\base.py", line 490, in run_env
util.load_python_file(self.dir, "env.py")
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\util\pyfiles.py", line 97, in load_python_file
module = load_module_py(module_id, path)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\util\compat.py", line 182, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py", line 93, in <module>
run_migrations_online()
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py", line 86, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\runtime\environment.py", line 813, in run_migrations
self.get_context().run_migrations(**kw)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\runtime\migration.py", line 561, in run_migrations
step.migration_fn(**kw)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\migrations\versions\fdc58d9bd449_.py", line 122, in upgrade
Security(current_app, user_datastore, register_blueprint=False)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 1062, in __init__
self._state = self.init_app(
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 1102, in init_app
self._state = state = _get_state(app, datastore, **kwargs)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 608, in _get_state
remember_token_serializer=_get_serializer(app, "remember"),
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 593, in _get_serializer
return URLSafeTimedSerializer(secret_key=secret_key, salt=salt)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\itsdangerous\serializer.py", line 104, in __init__
self.secret_keys: _t.List[bytes] = _make_keys_list(secret_key)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\itsdangerous\signer.py", line 64, in _make_keys_list
return [want_bytes(s) for s in secret_key]
TypeError: 'NoneType' object is not iterable
I recently installed this on a different machine without any issues. Seems odd that a fresh build would have the issues. Almost makes me think I am lacking something the older build contains (python?), although this shouldn't be the case. There are lots of posts about this and I have tried everything suggested in them without resolution.
As Delsx pointed out in the comments, the standalone pgAdmin can be installed without the same issues from pgadmin.org/download. It appears this is a widespread bug that has been reported on the pgAdmin bug list, here and here
In the end the solution that work for me was:
Delete C:\Users\username\AppData\Roaming\pgadmin
Open the terminal and run C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgAdmin4.py file using python
Terminal view -> python execution
Run as administrator the "pgAdmin 4" app from the windows menu and it will work as expected
I had this issue as well.
I followed the suggested answer from nonethewiser, installing the stand-alone pgAdmin.
It didn't work after having deleted Roaming/pgadmin and starting as admin.
I tried the bundled pgAdmin again and it works, strangely.
The solution that work for me:
Download pgAdmin4 at:
https://www.postgresql.org/ftp/pgadmin/pgadmin4/v5.2/windows/
Download Sql server at:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
When setting, uncheck install pgAdmin 4 and StackBuilder.
I've been searching about this issue and I did the following
Delete C:\Users\username\AppData\Roaming\pgadmin folder
Add the next windows user enviroment variable
SQLITE_PATH = C:\Users\*YourUsername*\AppData\Roaming\pgadmin\pgadmin4.db
Open cmd at C:\Program Files\pgAdmin 4\v5\web and run with python the setup.py file
Install all missing dependencies if any
Once setup.py finishes successfully you should delete pgadmin folder from AppData again
Run setup.py one more time
Open pgAdming4 normally (not as administrator)
This workaround works for me
My setup is PostgreSQL 9.6, pgAdmin4 v5.3 and Python 3.9.5
This solution worked for me:
Remove pgAdmin4 only from your system (In Individual Component uninstall mode).
Then download and install pgAdmin4 at: https://www.postgresql.org/ftp/pgadmin/pgadmin4/v5.2/windows/
Delete C:\Users*YourUsername*\AppData\Roaming\pgadmin
Run PgAdmin4
If even the standalone pgAdmin4 exe doesn't work, go to the python virtual enviroment (if you don't have any then install it using pip). Install the pgAdmin package in the virtual environment(pip install pgadmin4). Navigate to C:\Users(username)\Envs(or you respective env folder)\test( or your respective environment name)\Lib\site-packages\pgadmin4\pgAdmin4.py.
Incase while running the py file you may run into cheroot module no fot found, then inside the virtual env install pip install cheroot and you're done.
Remember to activate the evironment before doing this. Do this in two seperate cmd windows for convinience.
the above mentioned procedure is sure to work even if the exe is not working.
Also verify once that postgresql is listening in port: 5432 else change the port in postgresql.conf
I faced this issue on Linux Elementary OS and what solved my question was to configure PgAdmin from port 5432 to another port like 5437 because pgAdmin had a conflict of starting at port 5432 which was already being used by Postgres
Same error i was facing 2 days, but am not understand why it was showing, simply i setup environmental variable
C:\Program Files\PostgreSQL\15\bin

Why am I getting a read-only file system from github and an error when trying to install apache airflow?

I am working on VirtualBox 6.0 with Python 3.5. I am trying to install airflow from github using the requirements-python3.5.txt file (https://raw.githubusercontent.com/apache/airflow/v1-10-stable/requirements/requirements-python3.5.txt). However, when I try to download this file from the command line, I get a read-only file system:
vagrant#learnairflow:~$ source .sandbox/bin/activate
(.sandbox) vagrant#learnairflow:~$ wget https://raw.githubusercontent.com/apache/airflow/v1-10-stable/requirements/requirements-python3.5.txt
--2020-06-13 15:47:54-- https://raw.githubusercontent.com/apache/airflow/v1-10-stable/requirements/requirements-python3.5.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.232.48.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.48.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6210 (6.1K) [text/plain]
requirements-python3.5.txt: Read-only file system
Cannot write to ‘requirements-python3.5.txt’ (Success).
Subsequently, when I try to install airflow I get the following error:
(.sandbox) vagrant#learnairflow:~$ pip install "apache-airflow[celery, crypto, mysql, rabbitmq, redis]"==1.10.10 --constraint requirements-python3.5.txt
WARNING: The directory '/home/vagrant/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
ERROR: Exception:
Traceback (most recent call last):
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
status = self.run(options, args)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper
return func(self, options, args)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/commands/install.py", line 288, in run
wheel_cache = WheelCache(options.cache_dir, options.format_control)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cache.py", line 296, in __init__
self._ephem_cache = EphemWheelCache(format_control)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cache.py", line 265, in __init__
globally_managed=True,
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/utils/temp_dir.py", line 137, in __init__
path = self._create(kind)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/utils/temp_dir.py", line 185, in _create
tempfile.mkdtemp(prefix="pip-{}-".format(kind))
File "/usr/local/lib/python3.5/tempfile.py", line 358, in mkdtemp
prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
File "/usr/local/lib/python3.5/tempfile.py", line 130, in _sanitize_params
dir = gettempdir()
File "/usr/local/lib/python3.5/tempfile.py", line 296, in gettempdir
tempdir = _get_default_tempdir()
File "/usr/local/lib/python3.5/tempfile.py", line 231, in _get_default_tempdir
dirlist)
FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/vagrant']
I've tried using the sudo command but it doesn't work either. Do you have any idea of what might be causing this error and how to fix it? Thank you in advance!

pydev debugger fails on launch but code runs fine

When I launch the pydev debugger with LiClipse (latest versions of both) I get a "KeyError:" exception.
I have ensured that the workspace folder has the proper permissions. I get this problem even if I run LiClipse in Administrator mode.
I expect to be able to debug my python code. My actual results are the following errors:
pydev debugger: starting (pid: 15388)
Traceback (most recent call last):
File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\pydevd_file_utils.py", line 487, in _original_file_to_client
return cache[filename]
KeyError: 'c:\\users\\xyz\\my documents\\liclipse workspace\\xyzjirabot\\xyzjirabot.py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\_pydevd_bundle\pydevd_net_command_factory_xml.py", line 197, in make_thread_stack_str
py_db, curr_frame, frame_id_to_lineno
File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\_pydevd_bundle\pydevd_net_command_factory_xml.py", line 170, in _iter_visible_frames_info
filename_in_utf8 = pydevd_file_utils.norm_file_to_client(abs_path_real_path_and_base[0])
File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\pydevd_file_utils.py", line 489, in _original_file_to_client
translated = _path_to_expected_str(get_path_with_real_case(_AbsFile(filename)))
File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\pydevd_file_utils.py", line 196, in _get_path_with_real_case
return _resolve_listing(drive, iter(parts))
File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\pydevd_file_utils.py", line 159, in _resolve_listing
dir_contents = cache[resolved_lower] = os.listdir(resolved)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\xyz\\My Documents'
While I was posting this question I noticed that there is a capitalization difference with the file name being used as the key and the actual file path. I moved the workspace to the root of my C Drive and that seems to have fixed the problem.
I think it's the spaces in the filename. I moved it to \Users\kieveli\Source\LiClipseWorkspace\ and everything worked correctly.
Had the same issue - Path was set to "..\My Documents" instead of just "..\Documents". Changing the workspace to another directory fixed the problem

Error when creating virtualenv folder

I am working through the book Test Driven Devlopement, and am currently having a problem when I try to create a virtualenv folder using:
virtualenv --python=python3 ../virtualenv
I keep on getting this output:
Traceback (most recent call last):
File "C:\Python33\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python33\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
File "C:\Python33\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
File "C:\Python33\lib\site-packages\virtualenv.py", line 774, in main
interpreter = resolve_interpreter(options.python)
File "C:\Python33\lib\site-packages\virtualenv.py", line 1575, in resolve_interpreter
python_versions = get_installed_pythons()
File "C:\Python33\lib\site-packages\virtualenv.py", line 93, in get_installed_pythons
path = winreg.QueryValue(python_core, "%s\\InstallPath" % ver)
FileNotFoundError: [WinError 2] The system cannot find the file specified
You are on windows: ../virutalenv is for unix
On unix, you are telling virtualenv to create a virtualenv directory in the directory up one level (previous) also windows uses backslash instead of slash.
Try to find a tutorial that is windows oriented, or if you can get your hand on a unix/linux machine, or maybe install cygwin.

how to download a file using gsutil

I'm starting to use gsutil on windows xp.I have Python 2.7 in c:\Python27. I have setup and can run Python scripts including gsutil in my Windows PowerShell ide succesfully to list my files. EG gsutil ls -L gs://mybucket shows my files present and correct. The developers guide suggests the following example to download a file from storage
gsutil cp gs://cats/*.jpg file://pets/
I dont understand the syntax here. I have a file in storage gs://pussy/debug.txt and I want to download it to c:\test\debug.txt
How should I write this command.
I tried
gsutil cp gs://pussy/debug.txt file c:\test\
but it gives me the following error
At line:1 char:7
+ gsutil <<<< cp gs://pussy/debug.txt file c:\test\
+ CategoryInfo : NotSpecified: (Copying gs://pussy/debug.txt...:S
tring) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Traceback (most recent call last):
File "c:\gsutil\gsutil.py", line 88, in <module>
sys.exit(gslib.__main__.main())
File "c:\gsutil\gslib\__main__.py", line 199, in main
parallel_operations)
File "c:\gsutil\gslib\__main__.py", line 287, in _RunNamedCommandAndHandleExc
eptions
parallel_operations)
File "c:\gsutil\gslib\command_runner.py", line 188, in RunNamedCommand
return command_inst.RunCommand()
File "c:\gsutil\gslib\commands\cp.py", line 2273, in RunCommand
shared_attrs)
File "c:\gsutil\gslib\command.py", line 803, in Apply
use_thr_exc_handler=ignore_subprocess_failures)
File "c:\gsutil\gslib\command.py", line 908, in _ApplyThreads
return_value = func(args)
File "c:\gsutil\gslib\commands\cp.py", line 2143, in _CopyFunc
self._PerformCopy(exp_src_uri, dst_uri))
File "c:\gsutil\gslib\commands\cp.py", line 1560, in _PerformCopy
src_key = src_uri.get_key(False, download_headers)
File "c:\gsutil\third_party\boto\boto\storage_uri.py", line 189, in get_key
key = bucket.get_key(self.object_name, headers, version_id)
File "c:\gsutil\third_party\boto\boto\file\bucket.py", line 92, in get_key
fp = open(key_name, 'rb')
IOError: [Errno 2] No such file or directory: u'file'
Can anyone help ?
The first command is assuming unix paths. You'll need to do the following to use it on windows:
gsutil cp gs://folder/filename c:\destfolder\file
OR
gsutil cp gs://folder/filename file:///c|/destfolder/file
Or possibly even
gsutil cp 'gs://folder/filename' 'file:///c|/destfolder/file'
Or with variables
$src = 'gs://folder/filename';
$dest = 'file:///c:/destfolder/file'
gsutil cp $src $dest
I've had the same issue.
They way I make it work is simple, do not include ":" they are not allow on this type of path.
For example try something like this:
python gsutil cp -r gs://pubsite_prod_rev_XXXXXXXXXXXXXXXXXX/reviews/reviews_com.YYYYY.ZZZZ_201501.csv 'test/'
It will create a folder called test and save the file inside
Hope it helps.