Python: 2.7.12
Pip: 8.1.1
When I sudo pip install pandas, it shows as follows:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 512, in _prepare_file
finder, self.upgrade, require_hashes)
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 273, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 442, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 400, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 545, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 648, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 757, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 378, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
download .whl file for pandas
try
pip install pandas.whl
or upgrade or pip and repeat the command
pip install pandas
I think there is some problem with pip command. So you can install Anaconda for python 2.7 (Download). It comes with pip by default.
Once download will be completed (it is script file).
Give the permission to the script file.
sudo chmod 777 Anaconda2-5.1.0-Linux-x86_64.sh
Run the script file on terminal../Anaconda2-5.1.0-Linux-x86_64.sh or bash Anaconda2-5.1.0-Linux-x86_64.sh
Follow the instruction from point 4th to this document here
Related
In the last two weeks I noticed that my ironpython installation is not able to use pip anymore, e.g.:
ipy.exe -m pip install <package>
the stacktrace is similar to the following:
File "<path_to_bin>\bin\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "<path_to_bin>\bin\lib\site-packages\pip\commands\install.py", line 324, in run
requirement_set.prepare_files(finder)
File "<path_to_bin>\bin\lib\site-packages\pip\req\req_set.py", line 376, in prepare_files
discovered_reqs.extend(self._prepare_file(
File "<path_to_bin>\bin\lib\site-packages\pip\req\req_set.py", line 551, in _prepare_file
req_to_install.populate_link(
File "<path_to_bin>\bin\lib\site-packages\pip\req\req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "<path_to_bin>\bin\lib\site-packages\pip\index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "<path_to_bin>\bin\lib\site-packages\pip\index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "<path_to_bin>\bin\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "<path_to_bin>\bin\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "<path_to_bin>\bin\lib\site-packages\pip\index.py", line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File "<path_to_bin>\bin\lib\site-packages\pip\index.py", line 728, in __init__
self.parsed = html5lib.parse(
File "<path_to_bin>\bin\lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 35, in parse
if self.data.matchBytes(key):
File "<path_to_bin>\bin\lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 668, in matchBytes
data = self[p:p + len(bytes)]
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
for any package, even trying to update pip itself.
I currently use ironpython 2.7.12, but it seems to fail the same way with the beta 3.4. I install pip with the ensurepip module, which corresponds to pip-19.2.3 setuptools-41.2.0
I am in a VM environment (Win 7 VirtualBox) and had gotten the Anaconda 2.7 suite to work.
Being new to Python, I was working on some code that instructed me to install PythonWin to do some connection with Crystal Reports. Seemed to install OK but then started getting some errors about the kernel in Jupyter not starting.
Uninstalled everything and I think got rid of any bad links and such from the previous installs.
Did the fresh install of Anaconda 2.7 and did NOT install PythonWin. Now stuck with a broken/unable to load kernel in Jupyter. Here's the error below. All help much appreciated from this newbie. Thanks!
Traceback (most recent call last):
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\web.py", line 1592, in _execute
result = yield result
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\concurrent.py", line 261, in result
raise_exc_info(self._exc_info)
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "C:\Users\Victor\Anaconda2\lib\site-packages\notebook\services\sessions\handlers.py", line 73, in post
type=mtype))
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\concurrent.py", line 261, in result
raise_exc_info(self._exc_info)
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "C:\Users\Victor\Anaconda2\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\concurrent.py", line 261, in result
raise_exc_info(self._exc_info)
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "C:\Users\Victor\Anaconda2\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 92, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\concurrent.py", line 261, in result
raise_exc_info(self._exc_info)
File "C:\Users\Victor\Anaconda2\lib\site-packages\tornado\gen.py", line 326, in wrapper
yielded = next(result)
File "C:\Users\Victor\Anaconda2\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 160, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "C:\Users\Victor\Anaconda2\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "C:\Users\Victor\Anaconda2\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
**kw)
File "C:\Users\Victor\Anaconda2\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "C:\Users\Victor\Anaconda2\lib\site-packages\jupyter_client\launcher.py", line 138, in launch_kernel
proc = Popen(cmd, **kwargs)
File "C:\Users\Victor\Anaconda2\lib\subprocess.py", line 394, in __init__
errread, errwrite)
File "C:\Users\Victor\Anaconda2\lib\subprocess.py", line 644, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Figure I'll close the loop since I've found a solution - after uninstalling everything related to Anaconda and going through the file system and deleting all Anaconda related folders I re-installed Anaconda 2.7 as admin. Also during the setup I selected the choice to make the program available to all users.
Install finished and Anaconda 2.7 and all the modules worked as expected.
I am creating a virtual environment using mkvirtualenv, and I get this error, where have I gone wrong?
$ mkvirtualenv data
New python executable in /home/usman/.virtualenvs/data/bin/python
Installing setuptools, pip, wheel...
Complete output from command /home/usman/.virtualenvs/data/bin/python - setuptools pip wheel:
Collecting setuptools
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 386, in find_all_candidates
self.find_links, expand_dir=True)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 236, in _sort_locations
sort_path(os.path.join(path, item))
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 217, in sort_path
if mimetypes.guess_type(url, strict=False)[0] == 'text/html':
File "/usr/lib/python2.7/mimetypes.py", line 293, in guess_type
init()
File "/usr/lib/python2.7/mimetypes.py", line 358, in init
db.read(file)
File "/usr/lib/python2.7/mimetypes.py", line 202, in read
with open(filename) as fp:
IOError: [Errno 13] Permission denied: '/usr/local/lib/netscape/mime.types'
sudo chmod a+r /usr/local/lib/netscape/mime.types
This is probably because your file "mime.types" has not the sufficient permission status.
Use the chmod command as mentioned earlier.
I am trying to install hive on hadoop 2.7.2 with hdp 2.5. My ambari version is 2.4. Every other component is working fine (HDFS,YARN, MR2, ZOOKEEPER etc.).
When i am trying to install hive with new MySql database through ambari UI it give me following error for HCat client installation:
Traceback (most recent call last): File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py", line 85, in <module>
HCatClient().execute() File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
method(env) File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py", line 35, in install
self.install_packages(env) File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 567, in install_packages
retry_count=agent_stack_retry_count) File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
self.env.run() File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
self.run_action(resource, action) File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
provider_action() File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 54, in action_install
self.install_package(package_name, self.resource.use_repos, self.resource.skip_repos) File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 49, in install_package
self.checked_call_with_retries(cmd, sudo=True, logoutput=self.get_logoutput()) File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 83, in checked_call_with_retries
return self._call_with_retries(cmd, is_checked=True, **kwargs) File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 91, in _call_with_retries
code, out = func(cmd, **kwargs) File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
result = function(command, **kwargs) File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
tries=tries, try_sleep=try_sleep) File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
result = _call(command, **kwargs_copy) File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
raise Fail(err_msg) resource_management.core.exceptions.Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install hive_2_5_0_0_1245' returned 1. Error unpacking rpm package hive_2_5_0_0_1245-1.2.1000.2.5.0.0-1245.el6.noarch error: unpacking of archive failed on file /usr/hdp/2.5.0.0-1245/hive/conf: cpio: rename failed - Is a directory
Could you please help to solve this problem.
I have installed Python2.7, Selenium2Library, WXPython; Robot Framework...
when I want to start the Ride I got the following error.
:~$ ride.py
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/robotide/__init__.py", line 74, in main
_run(inpath, not noupdatecheck, debug_console)
File "/usr/local/lib/python2.7/dist-packages/robotide/__init__.py", line 100, in _run
ride = RIDE(inpath, updatecheck)
File "/usr/local/lib/python2.7/dist-packages/robotide/application/application.py", line 42, in __init__
wx.App.__init__(self, redirect=False)
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 8628, in __init__
self._BootstrapApp()
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 8196, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/robotide/application/application.py", line 47, in OnInit
self.settings = RideSettings()
File "/usr/local/lib/python2.7/dist-packages/robotide/preferences/settings.py", line 316, in __init__
user_path = initialize_settings(default_path)
File "/usr/local/lib/python2.7/dist-packages/robotide/preferences/settings.py", line 29, in initialize_settings
SETTINGS_DIRECTORY, path, dest_file_name)
File "/usr/local/lib/python2.7/dist-packages/robotide/preferences/settings.py", line 46, in _copy_or_migrate_user_settings
SettingsMigrator(source_path, settings_path).migrate()
File "/usr/local/lib/python2.7/dist-packages/robotide/preferences/settings.py", line 94, in migrate
self.merge()
File "/usr/local/lib/python2.7/dist-packages/robotide/preferences/settings.py", line 98, in merge
self._write_merged_settings(self._default_settings, self._user_path)
File "/usr/local/lib/python2.7/dist-packages/robotide/preferences/settings.py", line 186, in _write_merged_settings
'Could not open settings file "%s" for writing' % path)
RuntimeError: Could not open settings file "/home/said/.robotframework/ride/settings.cfg" for writing
The error message is clear:
RuntimeError: Could not open settings file "/home/said/.robotframework/ride/settings.cfg" for writing
Possible solutions:
cd ; pwd ;
/home/said
rm -rf .robotframework
or
sudo chown -R said:said .robotframework