Error setting up a virtualenv with jython 2.7b3 - virtualenv

I'm trying to set up a virtual environment using jython 2.7b3. I'm running Mac OS 10.8.5 in case that's relevant.
I installed virtualenv (1.11.6) using jython and easy_install as recommended here: http://www.jython.org/jythonbook/en/1.0/appendixA.html
But when I run:
$ /usr/local/jython/jython2.7b3/bin/virtualenv jython-venv
I get the output:
Cannot find file /usr/local/jython/jython2.7b3/Include (bad symlink)
New jython executable in jython-venv/bin/jython
ERROR: The executable jython-venv/bin/jython is not functioning
ERROR: It thinks sys.prefix is u'/usr/local/jython/jython2.7b3' (should be u'/..../jython-venv')
ERROR: virtualenv is not compatible with this system or executable
(Where /..../jython-venv stands for the path to the new virtual environment I created.)
When I run jython-venv/bin/jython I get a normal jython prompt:
$ jython-venv/bin/jython
Jython 2.7b3 (default:e81256215fb0, Aug 4 2014, 02:39:51)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_51
Type "help", "copyright", "credits" or "license" for more information.
>>>
What am I missing? Why does virtualenv think the executable doesn't work, even though it seems to be functioning OK by itself? Is it just a matter of telling it the correct sys.prefix? If so how can I do that?
Many thanks in advance for your help...

Found the problem and solution described here:
http://seletz.github.io/blog/2012/04/06/jython-classpath-virtualenv/
Apparently there is a bug in virtualenv that causes this issue when JYTHON_HOME is set, which was my problem.
As soon as it's unset with unset JYTHON_HOME, virtualenv works (almost) as expected.
$ echo $JYTHON_HOME
/usr/local/jython/jython2.7b3
$ unset JYTHON_HOME
$ echo $JYTHON_HOME
I say "almost" as expected because it still had an issue installing pip. Luckily that problem and its solution described here: https://gist.github.com/skyl/ea2ab1c62a547e381411

Related

Neovim Mason plugin cannot install Linters or Formatters

I'm quite new to neovim and mostly use it for simple c++ development. Love the motions and customizability, however I cannot find what I'm doing wrong when trying to install the clang-formatter using Mason plugin.
Using the visual interface provided by Mason I navigate to the 'formatter' section, position my cursor on the clang-formatter option and press I. It starts something but always fails with the same error message:
Mason Error Message
(I get the same error when installing linters)
So far installing LSP's has been no problem, and I've tried to google what the 'Error: name cmd not found' meant but haven't found anything that seems related.
I've made sure to update both my python3 and python3-pip packages. I believe that the virtual environment package became standard since python3.3 so I haven't installed that separately.
':checkhealth mason' output
My Check Health
If anybody has experienced something similar I'd love to hear how you've solved it!
Did you installed pynvim? It is what makes the bridge between neovim and python stuff I guess, it is optional to have it but could fix your issue. My healthcheck looks like this :
provider: health#provider#check
========================================================================
## Clipboard (optional)
- OK: Clipboard tool found: xclip
## Python 3 provider (optional)
- INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment.
- INFO: Multiple python3 executables found. Set `g:python3_host_prog` to avoid surprises.
- INFO: Executable: /usr/bin/python3
- INFO: Other python executable: /bin/python3
- INFO: Python version: 3.8.10
- INFO: pynvim version: 0.4.3
- OK: Latest pynvim is installed.
To install pynvim (in your shell):
pip3 install pynvim

stack-protector enabled but compiler support broken while installing VirtualBox Guest Additions with devtoolset-8

Note: This problem, which I have already solved, is a very different problem from every other similar question on Stack Overflow. I have posted this question and answer in the hopes that it will help someone else experiencing the same issue (or so that, when I have this problem again in 3 years, I'll find this answer).
I am running VirtualBox 6.1.26 on macOS Catalina 10.15.7. I am emulating centOS 7:
$ uname -r
3.10.0-1160.36.2.el7.x86_64
I "inserted" the VirtualBox Guest Additions CD and followed the auto-run prompts to install the Guest Additions. Part way through, it aborted, saying:
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
Note that I have gcc, make, perl, kernel-devel, and kernel-headers all installed. It also prompted me to check the file /var/log/vboxadd-setup.log for more details. The contents of that log were interesting:
Building the main Guest Additions 6.1.26 module for kernel 3.10.0-1160.36.2.el7.x86_64.
Error building the module. Build output follows.
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/3.10.0-1160.36.2.el7.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j4 modules
arch/x86/Makefile:96: stack-protector enabled but compiler support broken
arch/x86/Makefile:166: *** CONFIG_RETPOLINE=y, but not supported by the compiler. Compiler update recommended.. Stop.
make: *** [vboxguest] Error 2
modprobe vboxguest failed
Extensive searching for these errors yields multiple forum posts and Stack Overflow questions whose replies and accepted answers reveal either that I'm missing one of those installed packages (I'm not) or that my GCC version is less than 7.3 (when support for CONFIG_RETPOLINE=y was added). However:
$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
This is > 7.3, so it does support this feature. I should note that I installed GCC using the Yum devtoolset packages in order to use this newer compiler:
$ sudo yum list installed|grep devtoolset
...
devtoolset-8-gcc.x86_64 8.3.1-3.2-el7 #centos-sclo-rh
devtoolset-8-gcc-c++.x86_64 8.3.1-3.2-el7 #centos-sclo-rh
devtoolset-8-gcc-gdb-plugin.x86_64 8.3.1-3.2-el7 #centos-sclo-rh
...
devtoolset-8-make.x86_64 1:4.2.1-4.el7 #centos-sclo-rh
...
And I do not have any other GCC versions installed:
$ sudo yum list installed|grep gcc
devtoolset-8-gcc.x86_64 8.3.1-3.2-el7 #centos-sclo-rh
devtoolset-8-gcc-c++.x86_64 8.3.1-3.2-el7 #centos-sclo-rh
devtoolset-8-gcc-gdb-plugin.x86_64 8.3.1-3.2-el7 #centos-sclo-rh
libgcc.x86_64 4.8.5-44.el7 #anaconda
And I have this in ~/.bashrc to enable devtoolset upon login:
...
source scl_source enable devtoolset-8
...
What am I doing wrong?
It turned out the problem wasn't that I was using the wrong GCC version (not possible) or that I was missing any installed packages (I wasn't). Instead, it was a consequence of how the VirtualBox Guest Additions "auto-run" works. Something about the way it runs results in a "fresh" environment without devtoolset-8 properly sourced. As a result, it cannot find the installed GCC 8.3.
The solution was simple: When the auto-run prompt appeared, I dismissed it and did not run auto-run. Instead, I opened a fresh Terminal window and changed directories to /run/media/[username]/VBox_GAs_6.1.26 (YMMV on the exact location of the mounted disk), then ran this command:
$ sudo ./VBoxLinuxAdditions.run
That command completed successfully, the kernel module compiled, the Guest Additions installed, and they are working properly now.

import serial - Linux Mint 17, 64-bit, python3.5

I am going to be asking a question that seems to have been asked numerous times. However, all of the solutions posted in the others, seems to not be working. This leads me to believe that my problem may be system related, but I'm not an expert.
I am a newbie to Python, but not to Linux, and not a newbie to software by any means.
I am running Linux Mint, 17.3 (Rosa), 64-bit, and have recently installed Python3.5 per https://www.reddit.com/r/linuxquestions/comments/3nbfdx/how_to_upgrade_from_python_27_to_35_linux_mint/ and that seems to have worked.
Python 3.5.0 (default, Nov 19 2016, 10:27:39)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
When running:
pip list | grep pyserial
I get the following:
pyserial (2.6)
My problem is simply this: I can't run the following pyPractice.py file:
import serial
...with the following cli prompt:
me#machine /home/me/Desktop/practice $ python3.5 pyPractice.py
I have tried many solutions, such as those posted in the following locations, but all seem to have failed for one reason or another:
1) pyserial, ImportError: No module named serial
RESULT-> pyserial is already installed, as you can see above. When I tried to install 'serial', no dice, not recognized
me#machine /home/me/Desktop/practice $ sudo pip install serial
[sudo] password for me:
Downloading/unpacking serial
Could not find any downloads that satisfy the requirements serial
Cleaning up...
No distributions at all found for serial
Storing debug log for failure in /home/me/.pip/pip.log
2) Python ImportError: No module named serial
RESULT-> nearly the same as above. Near the end, the proposed fix is to type:
sudo apt-get install python3-serial
However, I get the following:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-serial is already the newest version.
The following package was automatically installed and is no longer required:
php5
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 379 not upgraded.
3) Serial import python
RESULT-> No sure...I started to look at this option, but wouldn't you know it, there isn't a serial in my python3.5 packages. So, even if I did have a path correct, I wouldn't know where to start.
I am pretty new to Python, so feel free to take me back to basics. I am not adverse to reading, so links to sites which explain your thoughts are acceptable. I am pretty handy with Linux.
[somewhat useless side note: I am trying to start out slow, but am trying to work through running a simple cube drawing script, which was found here ]
In your first method there are two errors: for Python 3 you should use the command pip3, and the module is called pyserial.
As for the second method, maybe the package has been installed improperly. Try to remove it and install again, maybe with the option --reinstall. Also maybe the command sudo dpkg-reconfigure python3-serial would help.

yum command : python version mismatch

I have Red Hat Linux (Red Hat Enterprise Linux Server release 6.5 (Santiago) ) and yum in not working with message
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named yum
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.7.8 (default, Nov 7 2014, 11:45:08)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
Current version of python is 2.7.8
Any help is appreciated.
CentOS 6 ships with python 2.6. Someone installed an incompatible version of python system-wide and that has broken things. That should not have been done.
You need to find out how the 2.7 version of python was installed and fix that (by removing the incorrect package or by removing the source-installed python or by fixing the $PATH or whatever else is appropriate).
To help figure out what the problem is exactly we need the output from the following commands (as a start).
What does rpm -qa python\* say?
What does which -a python say?

'no version information available' warning when starting pypy on centos6

I've been struggling with this for a few hours and not sure how to get rid of it(or if it'll cause any problems for me) but I keep getting the following warnings when I start pypy on centos6:
[root#domU-123 bin]# ./pypy
./pypy: /usr/lib64/libssl.so.0.9.8: no version information available (required by ./pypy)
./pypy: /usr/lib64/libcrypto.so.0.9.8: no version information available (required by ./pypy)
Python 2.7.2 (0e28b379d8b3, Feb 09 2012, 19:41:03)
[PyPy 1.8.0 with GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``"Let's go." - "We can't" - "Why
not?" - "We're waiting for a Translation." - (despairingly) "Ah!"''
>>>>
Here's a copy of my install script(I install this on a fresh centos system):
#install pypy
wget https://bitbucket.org/pypy/pypy/downloads/pypy-1.8-linux64.tar.bz2
tar xvf pypy*
yum -y install openssl098e
ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8
ln -s /usr/lib64/libcrypto.so.0.9.8e /usr/lib64/libcrypto.so.0.9.8
ln -s /lib64/libbz2.so.1.0.4 /lib64/libbz2.so.1.0
Can anyone suggest how to fix it? Am I missing a package or does something need to be configured?
this is the dreaded binary compatibility problem with linux
basically if you don’t have the same distro/version as the build server,
you can assume it may break due to distro policies wrt libs
for recent builds, its likely broken on anything that’s not similar
to whats on the build server (which runs a recent ubuntu)
(before it was a debian, but that broke openssl in strange ways on a regular basis)
since distros seem break general binary compatibility on regular basis,
this is not something that the pypy core team will spend more time on
external maintainers wanted