Lektor crashes on installation on Linux (Mint 19 and Raspbian-armv7l 2018-10) with a 'File not found error'
Python 2.7 and 3.5 are installed.
sudo apt-get install python-dev libssl-dev libffi-dev OK
sudo apt-get install imagemagick OK
curl -sf https://www.getlektor.com/install.sh | sudo sh
This script will install Lektor on your computer.
Installing at:
bin: /usr/local/bin
app: /usr/local/lib/lektor
Continue? [Yn] y -> CRASH !
/usr/bin/python: can't open file './virtualenv.py': [Errno 2] No such file or directory
Traceback (most recent call last):
File "<stdin>", line 148, in <module>
File "<stdin>", line 143, in main
File "<stdin>", line 107, in install
File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
This is a known issue with your version of Lektor:
https://github.com/lektor/lektor/issues/619
WORKAROUND:
For my system, install.sh worked after changing line 124 to this:
Popen([sys.executable, './src/virtualenv.py', lib_dir], cwd=t).wait()
Related
I am using ubuntu 16.04, what and installed for the first time and I try to install pip3 install virtualenvwrapper for it tells me to install first sudo apt install python3-pip once you install it I run the command pip3 install virtualenvwrapper but it generates the following error.
Collecting virtualenvwrapper
Downloading https://files.pythonhosted.org/packages/c1/6b/2f05d73b2d2f2410b48b90d3783a0034c26afa534a4a95ad5f1178d61191/virtualenvwrapper-4.8.4.tar.gz (334kB)
100% |████████████████████████████████| 337kB 233kB/s
Complete output from command python setup.py egg_info:
Couldn't find index page for 'pbr' (maybe misspelled?)
No local packages or download links found for pbr
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-xwa__f7e/virtualenvwrapper/setup.py", line 7, in <module>
pbr=True,
File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1092, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1104, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 380, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 657, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-xwa__f7e/virtualenvwrapper/
I have a Macbook running OS X 10.6 and I am trying to install pygame using pip3 install pygame.
Using python 3.7 and pip 18.0.
Below are the errors from the console.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/Z6/Z6RVS9IMHG4+tkl202dsTU+++TM/-Tmp-/pip-install-ftjsil2g/pygame/setup.py", line 609, in <module>
setup(**PACKAGEDATA)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 78, in run
_build_ext.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build_ext.py", line 309, in run
customize_compiler(self.compiler)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/sysconfig.py", line 170, in customize_compiler
_osx_support.customize_compiler(_config_vars)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_osx_support.py", line 418, in customize_compiler
_find_appropriate_compiler(_config_vars)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_osx_support.py", line 191, in _find_appropriate_compiler
"Cannot locate working compiler")
SystemError: Cannot locate working compiler
Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/Z6/Z6RVS9IMHG4+tkl202dsTU+++TM/-Tmp-/pip-install-ftjsil2g/pygame/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/Z6/Z6RVS9IMHG4+tkl202dsTU+++TM/-Tmp-/pip-record-vgz3goci/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/Z6/Z6RVS9IMHG4+tkl202dsTU+++TM/-Tmp-/pip-install-ftjsil2g/pygame/
Edit: Fixed formatting!
So I don't entirely understand what's going on with your error messages but I would recommend checking out this article as it covers setting up Pygame on Mac OSX 10.6-10.9 pretty well.
http://brysonpayne.com/2015/01/10/setting-up-pygame-on-a-mac/
If the above doesn't work, then follow the instructions bellow.
Note: I am covering every step so just skip the ones you have already done
Step 1: Install Python 3 and Pip
Download Python 3.7 here: Python 3.7.0.
Run the installer and make sure to select pip (I can't remember if this is optional or not).
Step 2: Install Pygame
Run the following command to install Pygame with pip:
python3 -m pip install -U pygame --user
Step 3: Test Pygame Installation
Run this command to test if Pygame installed correctly:
python3 -m pygame.examples.aliens
At the moment, 5/1/2020, you cannot install the pygame libraries in python 3.8 with pip install pygame, but you can install them with a particular version of them, still for dev.
You can install Python 3.8 in the command line using this version:
*pip install pygame==2.0.0.dev6*
Latest version:
*pip install pygame==2.0.0.dev10*
And you can check it with
Terminal:
$ python3
>>import pygame
pygame 2.0.0.dev10 (SDL 2.0.12, python 3.8.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
I'm trying to safely install PyMySQL. I've read many good arguments about why sudo pip install should be avoided, but sometimes it just seems impossible to get away from.
Is there a way to install PyMySQL locally in OSX without using sudo?
(VirtualEnv) : ^.^ :pip install --no-cache-dir --user PyMySQL
Collecting PyMySQL
Downloading PyMySQL-0.8.0-py2.py3-none-any.whl (83kB)
100% |████████████████████████████████| 92kB 1.8MB/s
Installing collected packages: PyMySQL
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "/Library/Python/2.7/site-packages/pip/locations.py", line 153, in distutils_scheme
i.finalize_options()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 346, in finalize_options
self.create_home_path()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 565, in create_home_path
os.makedirs(path, 0700)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Users/TomNason/Library/Python/2.7'
To install within a virtual env run this command.
pip install --install-option="--prefix=/Users/TomNason/VirtualEnv/lib/python2.7" PyMySQL
Generally- if you cannot install PyMySQL with pip inside a virtual environment (even if you are using the --user option) you can try...
pip install --install-option="--prefix=PATH_TO_YOUR_VIRTUAL_ENV_DIR/lib/PYTHON_VERSION" PyMySQL
This is still a curious situation for me. Any comments on why I would have to explicitely state my python directory are welcome. I thought that the reason for using a virtual environment was that pip will always choose to install there.
Here is the error I'm seeing. Is there something wrong in my install? Any help would be appreciated.
Installing collected packages: six, ipaddress, asn1crypto, enum34, pycparser, cffi, cryptography, pyOpenSSL, watson-developer-cloud
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/init.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-ny7QGZ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
Its a Mac OSX permission related problem. If you search for OSError: [Errno 1] Operation not permitted: you will find possible resolutions, favourites being:
brew install python
or
pip install --ignore-installed six
or using virtualenv
There is an entire discussion about this here : Six issue when installing package
The solution that worked for me is :
sudo pip install watson-developer-cloud --upgrade --ignore-installed six
I tried upgrade pip3 with this command:
sudo pip3 install --upgrade pip
but unfortunately it doesn't work anymore and shows this message:
pip3 --version
message:
Traceback (most recent call last):
File
"/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py",
line 651, in _build_master
ws.require(requires)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py",
line 952, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py",
line 844, in resolve
raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.VersionConflict: (pip 7.1.2
(/usr/local/lib/python3.4/dist-packages),
Requirement.parse('pip==1.5.6'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 5, in
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 3084, in
#_call_aside
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 3070, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 3097, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 653, in _build_master
return cls._build_from_requirements(requires)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 666, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 839, in resolve
raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'pip==1.5.6' distribution was
not found and is required by the application
How to fix it?
It seems like you don't use virtualenv and your pythons/paths are probably messed up.
I faced with similar problem with python-2.7 and -3.4 on Ubuntu 14.04. I tried
sudo python -m pip install --upgrade --force-reinstall pip
for 2.7 and it helped. Then I reinstalled pip for python-3.4 via easy_install3.