Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

TypeError: expected str, bytes or os.PathLike object, not int #6

Closed
107635 opened this issue Mar 11, 2020 · 10 comments
Closed

TypeError: expected str, bytes or os.PathLike object, not int #6

107635 opened this issue Mar 11, 2020 · 10 comments

Comments

@107635
Copy link

107635 commented Mar 11, 2020

When I used the command “python setup.py install” to download the mimkl package, an error occurred: "TypeError: expected str, bytes or os.PathLike object, not int".

Could you know how to solve this problem?

Thanks very much!

###########################################################
guo@guo-VirtualBox:~/下载/PIMKL/mimkl-master$ sudo python3 setup.py install
running install
running bdist_egg
running setup_pymimkl
Install _pymimkl
Updating submodules
Building pymimkl in /home/guo/下载/PIMKL/mimkl-master/build
Traceback (most recent call last):
File "setup.py", line 158, in
'Topic :: Scientific/Engineering :: Mathematics',
File "/home/guo/.local/lib/python3.6/site-packages/setuptools/init.py", line 144, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/guo/.local/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/guo/.local/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 102, in run
self.run_command('setup_pymimkl')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 86, in run
self._install_pymimkl()
File "setup.py", line 51, in _install_pymimkl
SETUP_DIR, build_directory, sys.executable, PROCESSES
File "/usr/lib/python3.6/subprocess.py", line 306, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.6/subprocess.py", line 287, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.6/subprocess.py", line 729, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1295, in _execute_child
restore_signals, start_new_session, preexec_fn)
TypeError: expected str, bytes or os.PathLike object, not int

@drugilsberg
Copy link
Member

Hi @107635, the problem looks quite difficult to debug without having additional detail on the operative system, python version tou are currently using. Can you provide those information?
That said, may I suggest you to use the docker image we provide to use mimkl? Here you can find the related web page

@107635
Copy link
Author

107635 commented Mar 11, 2020

Hi @drugilsberg I used the Ubuntu18.04, and the python 3.6.9.
I searched for a solution to this mistake, but I didn't find the answer. Could you know how to solve it? Thank you very much!

@drugilsberg
Copy link
Member

Hi @107635 I will look into this as soon as I have time. Could you use the docker image for the time being?

@drugilsberg
Copy link
Member

drugilsberg commented Mar 11, 2020

@107635 I tried to reproduce the bug without any success.
I started from a completely fresh environment in Ubuntu 18.04:

docker run -it ubuntu:18.04 /bin/bash

And setup the build system in a pretty standard fashion:

apt-get -y update && apt-get install -y build-essential g++ gcc make git zip unzip libopenblas-dev cmake python3-dev python3-pip
pip3 install --upgrade pip

Afterwards I tried to install the package after cloning and also directly from the remote.
After cloning:

git clone https://github.com/IBM/mimkl.git
cd mimkl
MIMKL_CXX_FLAGS="-O3 -fopenmp" pip install -e .

From remote:

MIMKL_CXX_FLAGS="-O3 -fopenmp" pip install git+https://[email protected]/IBM/mimkl.git

Both have been successful.
My suggestion is to try to install these packages:

sudo apt-get install -y g++ gcc make git zip unzip libopenblas-dev cmake python3-dev python3-pip

And also upgrade pip:

pip3 install --upgrade pip

And try again the installation.

@C-nit C-nit closed this as completed in 7254f94 Mar 24, 2020
@C-nit
Copy link
Member

C-nit commented Mar 24, 2020

Hi @107635 , thanks for reaching out and letting us know about this bug.
Your virtualbox had only a single core. Apparently we never tested this setting and indeed had a TypeError.

@107635
Copy link
Author

107635 commented Mar 26, 2020

Hi @drugilsberg & @C-nit ,thanks for your help. I re-installed the virtual machine and downloaded the mimkl package successfully. Thank you very much!

@1998Suraj
Copy link

When I used the command “python manage.py runserver” in an atom text editor to open my project on chrome, an error occurred: "TypeError at /
expected str, bytes, or os.PathLike object, not tuple".

Could you know how to solve this problem?

Thanks very much!

###########################################################

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/

Django Version: 3.1.1
Python Version: 3.6.12
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback (most recent call last):
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\core\handlers\base.py", line 179, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "D:\Full Stack Course\Django Full Stack\My Django Stuff\Django L2\Project\first_project\first_project\first_app\views.py", line 7, in index
return render(request,'first_app/index.html', context= my_dict)
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\shortcuts.py", line 19, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\template\loader.py", line 61, in render_to_string
template = get_template(template_name, using=using)
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\template\loader.py", line 15, in get_template
return engine.get_template(template_name)
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\template\backends\django.py", line 34, in get_template
return Template(self.engine.get_template(template_name), self)
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\template\engine.py", line 143, in get_template
template, origin = self.find_template(template_name)
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\template\engine.py", line 125, in find_template
template = loader.get_template(name, skip=skip)
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\template\loaders\base.py", line 18, in get_template
for origin in self.get_template_sources(template_name):
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\template\loaders\filesystem.py", line 36, in get_template_sources
name = safe_join(template_dir, template_name)
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\site-packages\django\utils_os.py", line 17, in safe_join
final_path = abspath(join(base, *paths))
File "C:\Users\Mowgli\anaconda3\envs\surajDjangoEnv\lib\ntpath.py", line 76, in join
path = os.fspath(path)

Exception Type: TypeError at /
Exception Value: expected str, bytes or os.PathLike object, not tuple

@drugilsberg
Copy link
Member

Hey @1998Suraj are you sure this is related to the mimkl repo, maybe you should open it in the django repo.

@akash-harijan
Copy link

upgrade you pip via

curl https://bootstrap.pypa.io/get-pip.py | python -

I had same problem, and I was using pip (9.0.1) version, but when I upgraded pip to (20.3.3), it got resolved.

@stweil
Copy link

stweil commented Mar 19, 2022

Python 3.6 now needs a slightly different command:

curl https://bootstrap.pypa.io/pip/3.6/get-pip.py | python -

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants