I am attempting to install the package PyPDF2 and get the below error.
I have anaconda installed on my machine with the package installed in another environment.
Can I run a pip install command from ?
c:\\program files\\alteryx\\bin\\miniconda3\\pythontool_venv\\scripts\\python.exe', '-m', 'pip', 'install', 'PyPDF2'
# List all non-standard packages to be imported by your
# script here (only missing packages will be installed)
from ayx import Package
Package.installPackages(['PyPDF2'])
Installing...
(this may take a minute depending on the package size, dependencies, and other factors)
Collecting PyPDF2
Downloading https://files.pythonhosted.org/packages/b4/01/68fcc0d43daf4c6bdbc6b33cc3f77bda531c86b174cac56ef0ffdb96faab/PyPDF2-1.26.0.tar.gz (77kB)
Installing collected packages: PyPDF2
Running setup.py install for PyPDF2: started
Running setup.py install for PyPDF2: finished with status 'error'
Complete output from command "c:\program files\alteryx\bin\miniconda3\pythontool_venv\scripts\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\pta67589\\AppData\\Local\\Temp\\6\\pip-build-7g46na7v\\PyPDF2\\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\pta67589\AppData\Local\Temp\6\pip-960hoi9i-record\install-record.txt --single-version-externally-managed --compile --install-headers "c:\program files\alteryx\bin\miniconda3\pythontool_venv\include\site\python3.6\PyPDF2":
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\PyPDF2
copying PyPDF2\filters.py -> build\lib\PyPDF2
copying PyPDF2\generic.py -> build\lib\PyPDF2
copying PyPDF2\merger.py -> build\lib\PyPDF2
copying PyPDF2\pagerange.py -> build\lib\PyPDF2
copying PyPDF2\pdf.py -> build\lib\PyPDF2
copying PyPDF2\utils.py -> build\lib\PyPDF2
copying PyPDF2\xmp.py -> build\lib\PyPDF2
copying PyPDF2\_version.py -> build\lib\PyPDF2
copying PyPDF2\__init__.py -> build\lib\PyPDF2
running install_lib
creating c:\program files\alteryx\bin\miniconda3\pythontool_venv\Lib\site-packages\PyPDF2
error: could not create 'c:\program files\alteryx\bin\miniconda3\pythontool_venv\Lib\site-packages\PyPDF2': Access is denied
----------------------------------------
Command ""c:\program files\alteryx\bin\miniconda3\pythontool_venv\scripts\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\pta67589\\AppData\\Local\\Temp\\6\\pip-build-7g46na7v\\PyPDF2\\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\pta67589\AppData\Local\Temp\6\pip-960hoi9i-record\install-record.txt --single-version-externally-managed --compile --install-headers "c:\program files\alteryx\bin\miniconda3\pythontool_venv\include\site\python3.6\PyPDF2"" failed with error code 1 in C:\Users\pta67589\AppData\Local\Temp\6\pip-build-7g46na7v\PyPDF2\
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
<ipython-input-1-74d64a4e6a9a> in <module>
2 # script here (only missing packages will be installed)
3 from ayx import Package
----> 4 Package.installPackages(['PyPDF2'])
c:\program files\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\ayx\Package.py in installPackages(package, install_type, debug)
86 result = subprocess.check_output(
87 [sys.executable, "-m", "pip"] + pip_args_list,
---> 88 stderr = subprocess.STDOUT
89 )
90 # print the output
C:\Program Files\Alteryx\bin\Miniconda3\lib\subprocess.py in check_output(timeout, *popenargs, **kwargs)
334
335 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 336 **kwargs).stdout 337
338
C:\Program Files\Alteryx\bin\Miniconda3\lib\subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
416 if check and retcode:
417 raise CalledProcessError(retcode, process.args,
--> 418 output=stdout, stderr=stderr) 419 return CompletedProcess(process.args, retcode, stdout, stderr)
420
CalledProcessError: Command '['c:\\program files\\alteryx\\bin\\miniconda3\\pythontool_venv\\scripts\\python.exe', '-m', 'pip', 'install', 'PyPDF2']' returned non-zero exit status 1.