First of all I am very new to cygwin and I didn't find similar question
It was pointed out that to install Python lib hdt that contains c++ code it is necessary to use Cygwin because some headers exist only in Posix.
Trying to install the lib earlier I installed MS BuildTools. When I tried to install the lib without Cygwin on Windows it was an error
BitSequence.cpp
hdt-cpp-1.3.3/libcds/include/libcdsBasics.h(27): fatal error C1083: ЌҐ г¤ Ґв
бп ®вЄалвм д ©« ўЄ«о票Ґ: sys/resource.h: No such file or directory,
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Buil
dTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x64\\cl.exe' failed with exi
t status 2
The error is from C:\Program Files (x86)\Microsoft Visual Studio
And I've find out that there is no way to avoid the error on Windows, and in won't be the error on Linux or using Cygwin.
Now I try to install Python lib in Cygwin. I do the same in Cygwin terminal (pip install hdt) and get the same error from Visual Studio.
Why doesn't Cygwin use gcc? I think that's a point of Cygwin usage. Of course if it uses VS it gets the same error.
I bet you are NOT using the cygwin Python and using instead a windows Version:
$ which pip
which: no pip in (/home/Marco/bin:/usr/local/bin:/usr/bin:/usr/lib/lapack:/usr/sbin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/d/utility)
$ which pip2
/usr/bin/pip2
$ which pip3
/usr/bin/pip3
Verify you have installed a Cygwin Python,
$ cygcheck -cd |grep "python3. "
python3 3.8.3-1
python36 3.6.10-1
python37 3.7.7-1
python38 3.8.3-1
$ cygcheck -cd |grep "python2. "
python2 2.7.18-1
python27 2.7.18-1
and try again with EG
Usage:
/usr/bin/python3.6 -m pip <command> [options]
/usr/bin/python3.6 -m pip install hdt
Related
I'm getting this error on Manjaro when trying to run cmake .. in a folder:
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
cmake version 3.25.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
I've installed cmake through sudo pamac install base-devel and I normally use clion, pointing to /usr/bin/cmake instead of the bundled cmake. I've tried using export CMAKE_ROOT=/usr/share/cmake as well as export CMAKE_ROOT=/usr/bin/cmake and sourcing my bashrc file and it still shows the same error. I've uninstalled cmake and reinstalled it, and still no-go. I've tried to run the command using /usr/bin/cmake and it doesn't work.
I'm getting an error when I try to installed the h3 package via pip. I running Python 3.6.
Here's the error:
Command "d:\pyth2\python.exe -u -c "import setuptools,
tokenize;file='c:\users\8523~1\appdata\local\temp\pip-install-0frm_v\h3\setup.py';f=getattr(tokenize,
'open', open)(file);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, file, 'exec'))" install
--record c:\users\8523~1\appdata\local\temp\pip-record-gizroq\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in c:\users\8523~1\appdata\local\temp\pip-install-0frm_v\h3\
How do I bypass this error?
I've installed all pre-required packages, except "make" which is unavailable on Windows.
Use Conda forge.
There is a h3-py package
While you can install make through conda, but it will not solve this problem. On h3-py page they said it's better not to use pip on windows and use cmake to install it instead.
See this reply:
https://github.com/uber/h3-py/issues/18#issuecomment-441454667
Or you can use the linux subsystem in windows to avoid any programming hassles.
The most useful advice is https://github.com/uber/h3-py/issues/32
For install H3-py on Windows 10 you need to have:
Any C++ compiler, for example - Visual Studio 2017
Cmake
Git for Windows
Windows subsystem for Linux (https://learn.microsoft.com/ru-ru/windows/wsl/install-win10). I'd recommend Kali. On linux you need to install packages - git, cmake and something else - follow the requirements of system.
Python 2.6 (in my case)
Then download h3-py - https://github.com/uber/h3-py
In folder h3-py-master there is a file "requirements-dev.txt". You need to install packages with Powershell (pip install -r "requirements-dev.txt"). Then you need to add some lines in script .install.sh:
...
VERSION=$1
IS_64BITS=$2
OS=Windows_NT
...
if [[ "True" == "$IS_64BITS" ]]; then
cmake . -DENABLE_FORMAT=OFF -DBUILD_SHARED_LIBS=ON -G "Visual Studio 15 2017 Win64"
And after all type in Powershell :
.install.sh v3.4.2 True
In subfolder "out" you will find "h3.dll". Copy to ".../python/DLLs"
I installed python 3x via home brew, the process was successful.
However when I check version, it shows 2x
here is the terminal output
➜ ~ brew install python
Warning: python 3.7.2 is already installed, it's just not linked
You can use `brew link python` to link this version.
➜ ~ brew link python
Linking /usr/local/Cellar/python/3.7.2... Error: Permission denied # dir_s_mkdir - /usr/local/Frameworks
➜ ~ sudo brew link python
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
➜ ~ python -V
Python 2.7.10
I think I need to modify some kind of path. And do some magic then pray...lol
Anyway anyone know how to get this work on my machine? I'm mac latest
First, solve your permission problem by running the official command from the Homebrew Documentation, Troubleshooting page
cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks
Then run brew link python
And finally run echo $PATH and check that your /usr/local/bin has precedence over other directories.
you could do brew uninstall python3 and install it from the python website here https://www.python.org/
When you go install a module you do pip3 install packageName
And when you run a program you could run it from your IDE (I recommend VSCode) or run it from the terminal with python3 drag_python_file_here
you have to use python3 instead of python on Mac so like python3 path/to/file.py and pip is now pip3 so like pip3 install pillow
I installed YCM with vim plug, but I may have shut down before process finished. Now when I start vim I get this error "The ycmd server SHUT DOWN (restart wit...the instructions in the documentation."
I've googled but can not find workable solution. I don't see anything in the documentation that helps. But I am new to vim and coding in general so may be missing something.
:YcmDebugInfo comes back with "Server errored, no debug info from server".
I have tried :YcmRestartServer, but to no result -- it pauses then returns the same error. I have also run :PlugInstall and :PlugUpdate, and all plug ins, including YCM, are coming back as up to date.
I ran into the same issue with Vundle and fixed it like this:
After installing cmake, I cd'd into ~.vim/bundle/YouCompleteMe and ran
python install.py
Another problem that may cause that error is conda, you should run install.py from the python's system and not the conda one, to do that use
/usr/bin/python ./install.py
from the youcompleteme folder inside vim
I was also facing the same problem with vim and I am using vim-plug plugin manager. To overcome this I did this:
cd ~/.vim/plugged/youcompleteme
python3 install.py
Done !!!
I was also facing the same issue but I have solved by executing the following commands in the Ubuntu terminal
cd ~/.vim/bundle/YouCompleteMe/
sudo pip install cmake
python install.py
or
cd ~/.vim/bundle/YouCompleteMe/
sudo pip install cmake
python3 install.py
Here is how I have solved
Mac OS Catalina 10.15.3
python 3.7
vim 8.2
Install ycm with 'Vim-plug' using Plug 'ycm-core/YouCompleteMe'
cd ~/.vim/plugged/YouCompleteMe
brew install cmake
python ./install.py
$ cd ~/.vim/plugged/youcompleteme
$ bash install.sh
(or)
$ python3 install.py
It will only work if you have installed the python3.7 version
Here is how I did this recently with following environments
Mac OS Mojave 10.14.3
Vim 8.1.300
Python 3.7
Java version 1.8.0_40
$vim --version | grep python
+comments +libcall -python +viminfo
+conceal +linebreak +python3 +vreplace
Installed ycm with Vundle using Plugin 'Valloric/YouCompleteMe' and then running :PluginInstall
The plugins in downloaded to ~/.vim/bundle/YouCompleteMe
$cd ~/.vim/bundle/YouCompleteMe
$python3 installer.py --java-completer
This creates appropriate files under /.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/eclipse.jdt.ls (make sure these and inner directories are not owned by root unless you always work as a root)
now open vim and execute :YcmRestartServer
You should be good to go.
Try :YcmDebugInfo to check if everything is fine
Printing YouCompleteMe debug information...
-- Client logfile: /var/folders/t4/y8zpydv91sv2dszlb1_3qw_r0000gn/T/ycm_1xgp1ub9.log
-- Server Python interpreter: /usr/local/bin/python
-- Server Python version: 3.7.0
-- Server has Clang support compiled in: False
-- Clang version: None
-- Extra configuration file found but not loaded
-- Extra configuration path: ~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py
-- Server running at: http://127.0.0.1:58050
-- Server process ID: 2334
-- Server logfiles:
-- /var/folders/t4/y8zpydv91sv2dszlb1_3qw_r0000gn/T/ycmd_58050_stdout_wzk9oksu.log
-- /var/folders/t4/y8zpydv91sv2dszlb1_3qw_r0000gn/T/ycmd_58050_stderr_xjb7zjn2.log
CentOS Linux release 7.6.1810 (Core)
Vim 8.1.1362
Python 3.7.3
Java openjdk version "1.8.0_191"
Overall process remains same, but I had couple of difficulties on Centos
Vim was not compiled with Python support
sudo vi /etc/ld.so.conf
added /usr/local/lib to it which had libpython3.7m.so.1.0 file
sudo ldconfig
git clone https://github.com/vim/vim.git
cd vim
./configure --prefix=/usr/local/ --enable-python3interp=yes --with-python3-command=/usr/local/bin/python --with-python3-config-dir=
Rest of the procedure remains the same.
2023:
macOS Monterey
Anaconda
Python installed with homebrew
Had to :
cd ~/.vim/bundle/YouCompleteMe/
# DONT use conda python in the following install step
/opt/homebrew/bin/python3 ./install.py
I installed the newer version of python (3.2.3) than the one available in Fedora16 (python2.7)
And now yum stops working. It shows the following error.
[root#localhost yum-3.4.3]# yum
File "/usr/bin/yum", line 30
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax
Please advice as how to resolve the error. It would be helpful as I am not able to update or install any package.
Because yum does not support Python3.
You can run command vi /usr/bin/yum, change /usr/bin/python to /usr/bin/python2 in first line.
Thus you can run the command yum by Python2 instead of Python3.
Note however that this will make your setup unsupported and thus unmaintainable (as does what you did). You will likely have other similar problems in the future with other system packages.
If you want to use an alternative Python installation, consider installing it into /usr/local, /opt or using pyenv.
This issue happens when user upgrades to python3, Just simply edit the file --> /usr/bin/yum and change to first line to --> "#!/usr/bin/python2"
The above solution wouldn't solve the all yum dependency problems, its better to run the below commands.
sudo ln -s /usr/local/bin/python3 /usr/bin/python3 (Mark latest python as python3)
sudo ln -sf /usr/bin/python2.7 /usr/bin/python (nake 2.7 as default python)
THanks,
Daman
I'm guessing you installed Python 3.2.3 from source and used "make install" as the last command. That command has the unfortunate side-effect of replacing the system installed version command "python" with the new version. Using "make altinstall" doesn't replace "python".
The command "python" is just a symbolic link to "python2", which in turn is a symbolic link to "python2.7". You should be able to restore "python" by executing the following command:
cd /usr/bin
sudo ln -s python2 python
Thanks Damanvir! Changing the line in /usr/bin/yum worked!
This is a little off topic and might be removed but it might help someone.
These are the steps I used to install Python 3.7 on Centos and fix the yum error.
Download from https://www.python.org/
tar -xvf
./configure --enable-optimizations
make
make install
OR
make altinstall
make altinstall is used to prevent replacing the default python binary file /usr/bin/python.
cd /usr/bin
Remove the current symbolic link to the previous version
rm python
OUTPUT: rm: remove symbolic link ‘python’? y
Find the location of the new version
whereis python3.7
OUTPUT: python3: /usr/local/bin/python3.7
Verify this is correct
/usr/local/bin/python3.7 --version
OUTPUT: Python 3.7.0
Create a symbolic link to the location of the new version
ln -s /usr/local/bin/python3.7 python
python --version
OUTPUT: Python 3.7.0
Yum commands will show the following error:
File "/bin/yum", line 30
except KeyboardInterrupt, e:
SyntaxError: invalid syntax
Change the top line of this file from using python to python2
vi /usr/bin/yum
#!/usr/bin/python2
Reference: https://tecadmin.net/install-python-3-7-on-centos/
The real answer - to ensure that you are back on a supportable version of python (in the event you are looking at this for an issue with RHEL 7).
cd /usr/bin
sudo unlink python
sudo ln -s python2 python
Your yum looks for python2. Let's use 'alternatives' to switch between pythons2 and python3.
run --> sudo alternatives --config python
Enter to keep the current selection[+], or type selection number:
If you don't configure it. How to do that?
sudo alternatives --install /usr/bin/python python
/usr/local/bin/python3.8 60
sudo alternatives --install
/usr/bin/python python /usr/bin/python2 50
It's only a binary link issue. You can copy the working /usr/bin/python2 from any system and copy to current system location /usr/bin/python2
#cd /usr/bin
#ln -s python2 python