debugging LibreOffice scriptforge python with pycharm on Windows 11 - python

I have created a python project in:
C:\Users\%USER%\AppData\Roaming\LibreOffice\4\user\Scripts\python\propertyManager
I tried to create the project with:
venv:
C:\Users%USER%\AppData\Roaming\LibreOffice\4\user\Scripts\python\propertyManager\venv-w
interpreter:
C:\Program Files\LibreOffice\program\python.exe
but I get an error:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Program Files\\LibreOffice\\program\\python-core-3.8.16\\bin\\pythonw.exe'

Related

Virtual Environment creation failed in a shared directory in Ubuntu 18.04 in virtual box

I was trying to install flask in my Ubuntu 18.04 virtual machine in order to implement an API which send emails.
I following this tutorial:
https://runnable.com/docker/python/dockerize-your-flask-application
when trying to set the virtual environment, I got this error with these two commands:
- python3 -m venv venv
error :
Error: [Errno 30] Read-only file system: 'lib' -> '/shared/BerryCert/Agent/Flask_Web/venv/lib64'
- Virtualenv venv
error :
File "/usr/lib/python3.6/shutil.py", line 365, in copytree
raise Error(errors)
shutil.Error: [('/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6.so', '/shared/BerryCert/Agent/Flask_Web/venv/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6.so', "[Errno 30] Read-only file system: '../../x86_64-linux-gnu/libpython3.6m.so.1' -> '/shared/BerryCert/Agent/Flask_Web/venv/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6.so'"), ('/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so', '/shared/BerryCert/Agent/Flask_Web/venv/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so', "[Errno 30] Read-only file system: '../../x86_64-linux-gnu/libpython3.6m.so.1' -> '/shared/BerryCert/Agent/Flask_Web/venv/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so'")]
Could you please explain the issue to me?
When creating the virtualenv, pass the --always-copy flag.
So something like: virtualenv --always-copy [your-environment].
This should copy environment files - not symlink them. There are sometimes issues with symlinks on virtualbox. Hope this helps!

How to fix OSError: [WinError 123] when publishing to PyPi

Full error:
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\Program Files\GDAL"'
Why is Python looking for the file C:\Program Files\GDAL" when I run the following?
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
I even created a folder named GDAL in my C:/Program files folder, but it's still not working? Why in the world must uploading a package to PyPi be such a pain?!?
Ok, so I figured it out - turns out my PYTHONPATH variable was set to C:\Program Files\GDAL" for some unknown reason. I changed it to C:\Users\\Anaconda3 and now it works!

How to fix setup.py error when trying to build a Visual Studio Code python solution

I created a build JSON file and I tried to build my simple python solution but I keep getting this error:
can't open file 'setup.py': [Errno 2] No such file or directory
The terminal process terminated with exit code: 2
I upgraded setuptools but the error is still there.

Error when pip installing mysql: c1.exe

I'm on Windows 10 and I've been trying to pip install mysql, but keep getting the error message:
error: command 'c1.exe' failed: No such file or directory
I have Microsoft VC 14 installed, at C:\Program Files (x86)\
For some reason when I installed python, it installed at C:\Users\name\AppData\Local\Programs\Python\Python36
I've tried moving c1.exe into the python folder, but that didn't help.
Do I need to move the python folder somewhere else? Will that mess up python in any way? Is there an easier fix?
UPDATE: I changed the PATH variable, and it resolved this error. Then it moved on to a new error:
I changed the path, and it resolved the error. Then I got a new error, related to the execution of c1.exe it seems:
_mysql.c
_mysql.c(42): fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\x86_amd64\\c1.exe' failed with exit status 2`
you might have to add a python path variable or change it. see config noted here: How to add to the pythonpath in windows 7?

PermissionError: [WinError 5] Access is Denied when Installing goose-extractor

I was trying to install goose-extractor using the tutorial on https://www.openshift.com/blogs/day-16-goose-extractor-an-article-extractor-that-just-works.
But while I execute the command at my command prompt on windows 7 as this:
virtualenv venv --python=C:\Python34
I got the Error:
Running virtualenv with interpreter c:\Python34
Traceback(most recent call last):
File "C:\Python34\Lib\runpy.py", line 170, in _run_module_as_main....
.....
.....
PermissionError: [WinError 5] Access is Denied
My Windows user is Administrator.
How can I solve this?
It seems you have to provide not only the python installation directory, but point to the python.exe file. Following command worked on my 64 bit windows 8.1 machine:
virualenv -p C:\Python2.7\python.exe

Categories